draw tile
This commit is contained in:
parent
6e6b792a58
commit
b5e670b491
5 changed files with 82 additions and 41 deletions
|
|
@ -4,7 +4,7 @@ use strum::{EnumCount, FromRepr};
|
|||
use crate::{
|
||||
EnumNextCycle,
|
||||
game::{
|
||||
hand::{Drawn, Hand},
|
||||
hand::{DrawnTile, Hand},
|
||||
player::{MainPlayer, Player},
|
||||
round::{CurrentPlayer, TurnState, Wind},
|
||||
wall::Wall,
|
||||
|
|
@ -40,7 +40,7 @@ impl Plugin for Riichi {
|
|||
.add_systems(OnEnter(GameState::Deal), hand::shuffle_deal)
|
||||
.add_systems(Update, hand::sort_hands.run_if(in_state(GameState::Play)))
|
||||
// .add_systems(Update, turn_manager.run_if(in_state(GameState::Play)))
|
||||
.add_systems(OnEnter(TurnState::Tsumo), tsumo)
|
||||
.add_systems(OnEnter(TurnState::Tsumo), round::tsumo)
|
||||
// semicolon stopper
|
||||
;
|
||||
}
|
||||
|
|
@ -53,31 +53,11 @@ impl Plugin for Riichi {
|
|||
|
||||
// fn turn_manager() {}
|
||||
|
||||
fn tsumo(
|
||||
mut commands: Commands,
|
||||
curr_player: Res<CurrentPlayer>,
|
||||
// players: Populated<Entity, With<Player>>,
|
||||
wall_ent: Single<Entity, With<Wall>>,
|
||||
walltiles: Single<&Children, With<Wall>>,
|
||||
curr_turnstate: Res<State<TurnState>>,
|
||||
mut next_turnstate: ResMut<NextState<TurnState>>,
|
||||
) {
|
||||
trace!("tsumo for: {:?}", curr_player.0);
|
||||
|
||||
let drawn = walltiles.last().unwrap();
|
||||
commands.entity(*wall_ent).remove_child(*drawn);
|
||||
commands.entity(curr_player.0).insert(Drawn(*drawn));
|
||||
|
||||
debug!("wall: {:?}", *walltiles);
|
||||
|
||||
next_turnstate.set(curr_turnstate.next());
|
||||
}
|
||||
|
||||
pub(crate) fn setup(
|
||||
mut commands: Commands,
|
||||
matchsettings: Res<round::MatchSettings>,
|
||||
// mut compass: ResMut<Compass>
|
||||
tiles: Query<Entity, With<Tile>>,
|
||||
// tiles: Query<Entity, With<Tile>>,
|
||||
mut next_gamestate: ResMut<NextState<GameState>>,
|
||||
) {
|
||||
for i in 1..=matchsettings.player_count {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue