fix deal crash
This commit is contained in:
parent
759ff410c2
commit
65ea256436
6 changed files with 15 additions and 55 deletions
|
|
@ -9,6 +9,7 @@ pub mod wall;
|
|||
#[derive(States, Default, Hash, Clone, Eq, Debug, PartialEq, Copy)]
|
||||
pub enum GameState {
|
||||
#[default]
|
||||
None,
|
||||
Setup,
|
||||
// Deal,
|
||||
Play,
|
||||
|
|
@ -22,12 +23,16 @@ impl Plugin for Riichi {
|
|||
.add_systems(Startup, init_match)
|
||||
.add_systems(Startup, tiles::init_tiles)
|
||||
.init_state::<GameState>()
|
||||
.add_systems(OnEnter(GameState::Setup), (wall::build_wall, player::deal_hands).chain())
|
||||
.add_systems(OnEnter(GameState::Setup), (wall::build_wall, player::deal_hands, setup_done).chain())
|
||||
// semicolon stopper
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
fn setup_done(mut next: ResMut<NextState<GameState>>) {
|
||||
next.set(GameState::Play);
|
||||
}
|
||||
|
||||
#[derive(Component)]
|
||||
pub(crate) struct Dice(u8, u8);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue