Start game from the lobby by the admin #86

Merged
raphael merged 8 commits from start-game into main 2024-03-31 13:47:28 +00:00
2 changed files with 3 additions and 2 deletions
Showing only changes of commit f044b9678a - Show all commits

View file

@ -35,11 +35,11 @@ pub enum PlayerRank {
Player, Player,
} }
/// TODO /// The event to start the game send by the admin.
#[derive(Event, Serialize, Deserialize)] #[derive(Event, Serialize, Deserialize)]
pub struct StartGame(pub StartMapGeneration); pub struct StartGame(pub StartMapGeneration);
/// TODO /// A fonction that handle the start of the game.
fn start_game( fn start_game(
mut next_stats: ResMut<NextState<CurrentScene>>, mut next_stats: ResMut<NextState<CurrentScene>>,
mut start_game_events: EventReader<Receive<StartGame>>, mut start_game_events: EventReader<Receive<StartGame>>,

View file

@ -87,6 +87,7 @@ fn lobby_ui(
}); });
} }
/// Get the map sizes form a given number of players.
fn get_map_sizes(number_of_players: u64) -> Vec<u64> { fn get_map_sizes(number_of_players: u64) -> Vec<u64> {
let mut result = Vec::with_capacity(6); let mut result = Vec::with_capacity(6);