gameServer2/src/server/room.rs
author Wuzzy <Wuzzy2@mail.ru>
Thu, 03 May 2018 21:02:05 +0200
changeset 13368 153e2f443cc9
parent 13119 1e39b8749072
child 13416 cdf69667593b
permissions -rw-r--r--
Simplify and shrink 5 SVG hats
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13119
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
     1
pub type RoomId = usize;
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
     2
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
     3
pub struct HWRoom {
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
     4
    pub id: RoomId,
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
     5
    pub name: String,
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
     6
    pub password: Option<String>,
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
     7
    pub protocol_number: u32,
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
     8
    pub ready_players_number: u8,
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
     9
}
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
    10
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
    11
impl HWRoom {
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
    12
    pub fn new(id: RoomId) -> HWRoom {
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
    13
        HWRoom {
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
    14
            id,
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
    15
            name: String::new(),
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
    16
            password: None,
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
    17
            protocol_number: 0,
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
    18
            ready_players_number: 0,
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
    19
        }
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
    20
    }
1e39b8749072 separated the server logic from all the async io mess.
alfadur
parents:
diff changeset
    21
}