rust/hedgewars-server/src/server/client.rs
changeset 14800 f43ab2bd76ae
parent 14714 6a2e13e36b7f
child 14807 8ecdb5c6bb2a
equal deleted inserted replaced
14799:bbec6b28d072 14800:f43ab2bd76ae
     7         const IS_MASTER = 0b0000_0010;
     7         const IS_MASTER = 0b0000_0010;
     8         const IS_READY = 0b0000_0100;
     8         const IS_READY = 0b0000_0100;
     9         const IS_IN_GAME = 0b0000_1000;
     9         const IS_IN_GAME = 0b0000_1000;
    10         const IS_JOINED_MID_GAME = 0b0001_0000;
    10         const IS_JOINED_MID_GAME = 0b0001_0000;
    11         const IS_CHECKER = 0b0010_0000;
    11         const IS_CHECKER = 0b0010_0000;
       
    12         const IS_CONTRIBUTOR = 0b0100_0000;
    12 
    13 
    13         const NONE = 0b0000_0000;
    14         const NONE = 0b0000_0000;
    14         const DEFAULT = Self::NONE.bits;
    15         const DEFAULT = Self::NONE.bits;
    15     }
    16     }
    16 }
    17 }
    64         self.contains(ClientFlags::IS_JOINED_MID_GAME)
    65         self.contains(ClientFlags::IS_JOINED_MID_GAME)
    65     }
    66     }
    66     pub fn is_checker(&self) -> bool {
    67     pub fn is_checker(&self) -> bool {
    67         self.contains(ClientFlags::IS_CHECKER)
    68         self.contains(ClientFlags::IS_CHECKER)
    68     }
    69     }
       
    70     pub fn is_contributor(&self) -> bool {
       
    71         self.contains(ClientFlags::IS_CONTRIBUTOR)
       
    72     }
    69 
    73 
    70     pub fn set_is_admin(&mut self, value: bool) {
    74     pub fn set_is_admin(&mut self, value: bool) {
    71         self.set(ClientFlags::IS_ADMIN, value)
    75         self.set(ClientFlags::IS_ADMIN, value)
    72     }
    76     }
    73     pub fn set_is_master(&mut self, value: bool) {
    77     pub fn set_is_master(&mut self, value: bool) {
    83         self.set(ClientFlags::IS_JOINED_MID_GAME, value)
    87         self.set(ClientFlags::IS_JOINED_MID_GAME, value)
    84     }
    88     }
    85     pub fn set_is_checker(&mut self, value: bool) {
    89     pub fn set_is_checker(&mut self, value: bool) {
    86         self.set(ClientFlags::IS_CHECKER, value)
    90         self.set(ClientFlags::IS_CHECKER, value)
    87     }
    91     }
       
    92     pub fn set_is_contributor(&mut self, value: bool) {
       
    93         self.set(ClientFlags::IS_CONTRIBUTOR, value)
       
    94     }
    88 }
    95 }