rust/hedgewars-server/src/server/coretypes.rs
changeset 14457 98ef2913ec73
parent 14415 06672690d71b
child 14687 5122c584804e
equal deleted inserted replaced
14456:a077aac9df01 14457:98ef2913ec73
    21 
    21 
    22     Ammo(String, Option<String>),
    22     Ammo(String, Option<String>),
    23     Scheme(String, Vec<String>),
    23     Scheme(String, Vec<String>),
    24     Script(String),
    24     Script(String),
    25     Theme(String),
    25     Theme(String),
    26     DrawnMap(String)
    26     DrawnMap(String),
    27 }
    27 }
    28 
    28 
    29 #[derive(PartialEq, Eq, Clone, Debug)]
    29 #[derive(PartialEq, Eq, Clone, Debug)]
    30 pub struct TeamInfo {
    30 pub struct TeamInfo {
    31     pub name: String,
    31     pub name: String,
    49 pub enum VoteType {
    49 pub enum VoteType {
    50     Kick(String),
    50     Kick(String),
    51     Map(Option<String>),
    51     Map(Option<String>),
    52     Pause,
    52     Pause,
    53     NewSeed,
    53     NewSeed,
    54     HedgehogsPerTeam(u8)
    54     HedgehogsPerTeam(u8),
    55 }
    55 }
    56 
    56 
    57 #[derive(Clone, Debug)]
    57 #[derive(Clone, Debug)]
    58 pub struct Voting {
    58 pub struct Voting {
    59     pub ttl: u32,
    59     pub ttl: u32,
    60     pub voters: Vec<ClientId>,
    60     pub voters: Vec<ClientId>,
    61     pub votes: Vec<(ClientId, bool)>,
    61     pub votes: Vec<(ClientId, bool)>,
    62     pub kind: VoteType
    62     pub kind: VoteType,
    63 }
    63 }
    64 
    64 
    65 impl Voting {
    65 impl Voting {
    66     pub fn new(kind: VoteType, voters: Vec<ClientId>) -> Voting {
    66     pub fn new(kind: VoteType, voters: Vec<ClientId>) -> Voting {
    67         Voting {
    67         Voting {
    68             kind, voters, ttl: 2,
    68             kind,
    69             votes: Vec::new()
    69             voters,
       
    70             ttl: 2,
       
    71             votes: Vec::new(),
    70         }
    72         }
    71     }
    73     }
    72 }
    74 }