equal
deleted
inserted
replaced
1 use crate::server::coretypes::{GameCfg, HedgehogInfo, ServerVar, TeamInfo, VoteType}; |
1 use crate::core::types::{GameCfg, HedgehogInfo, ServerVar, TeamInfo, VoteType}; |
2 use std::{convert::From, iter::once, ops}; |
2 use std::{convert::From, iter::once, ops}; |
3 |
3 |
4 #[derive(PartialEq, Eq, Clone, Debug)] |
4 #[derive(PartialEq, Eq, Clone, Debug)] |
5 pub enum HWProtocolMessage { |
5 pub enum HWProtocolMessage { |
6 // common messages |
6 // common messages |
181 } |
181 } |
182 } |
182 } |
183 |
183 |
184 impl GameCfg { |
184 impl GameCfg { |
185 pub fn to_protocol(&self) -> (String, Vec<String>) { |
185 pub fn to_protocol(&self) -> (String, Vec<String>) { |
186 use crate::server::coretypes::GameCfg::*; |
186 use crate::core::types::GameCfg::*; |
187 match self { |
187 match self { |
188 FeatureSize(s) => ("FEATURE_SIZE".to_string(), vec![s.to_string()]), |
188 FeatureSize(s) => ("FEATURE_SIZE".to_string(), vec![s.to_string()]), |
189 MapType(t) => ("MAP".to_string(), vec![t.to_string()]), |
189 MapType(t) => ("MAP".to_string(), vec![t.to_string()]), |
190 MapGenerator(g) => ("MAPGEN".to_string(), vec![g.to_string()]), |
190 MapGenerator(g) => ("MAPGEN".to_string(), vec![g.to_string()]), |
191 MazeSize(s) => ("MAZE_SIZE".to_string(), vec![s.to_string()]), |
191 MazeSize(s) => ("MAZE_SIZE".to_string(), vec![s.to_string()]), |