Implement message types and lobby join

This commit is contained in:
bel
2020-05-03 08:14:29 -06:00
parent dec077debb
commit f24cc62118
9 changed files with 270 additions and 7 deletions

View File

@@ -1,3 +1,4 @@
/*
use super::super::super::model::state::room::Room;
pub struct GameMaster {
@@ -10,6 +11,24 @@ impl GameMaster {
room: room,
}
}
fn run(&self) -> Result<String, String> {
self.run_lobby()?;
self.run_game_setup()?;
self.run_game()
}
fn run_lobby(&self) -> Result<String, String> {
Err("not impl".to_string())
}
fn run_game_setup(&self) -> Result<String, String> {
Err("not impl".to_string())
}
fn run_game(&self) -> Result<String, String> {
Err("not impl".to_string())
}
}
#[cfg(test)]
@@ -36,11 +55,29 @@ mod tests {
let _ = GameMaster::new(r);
}
#[test]
fn new_mockrooms() {
let mut mrs = MockRooms::new();
let r = mrs.create();
let _ = GameMaster::new(r);
}
#[test]
fn gm_run_lobby_fail() {
let gm = GameMaster::new(Box::new(MockRoom::create()));
panic!("not impl");
}
#[test]
fn gm_run_game_setup_fail() {
let gm = GameMaster::new(Box::new(MockRoom::create()));
panic!("not impl");
}
#[test]
fn gm_run_game_fail() {
let gm = GameMaster::new(Box::new(MockRoom::create()));
panic!("not impl");
}
}
*/