we start printing again
This commit is contained in:
parent
65ea256436
commit
59399c3590
7 changed files with 114 additions and 52 deletions
|
|
@ -1,7 +1,7 @@
|
|||
use bevy::prelude::*;
|
||||
|
||||
use crate::{
|
||||
game::wall::{InWall, Wall, WallTiles},
|
||||
game::wall::{InWall, Wall},
|
||||
tiles::Tile,
|
||||
};
|
||||
|
||||
|
|
@ -15,30 +15,3 @@ fn spawn_players(mut commands: Commands) {}
|
|||
#[derive(Component)]
|
||||
pub(crate) struct Points(pub isize);
|
||||
|
||||
#[derive(Component)]
|
||||
pub struct Hand;
|
||||
|
||||
#[derive(Component)]
|
||||
#[relationship_target(relationship = InHand, linked_spawn)]
|
||||
pub struct HandTiles(Vec<Entity>);
|
||||
|
||||
#[derive(Component)]
|
||||
#[relationship(relationship_target = HandTiles)]
|
||||
pub struct InHand(pub Entity);
|
||||
|
||||
pub(crate) fn deal_hands(
|
||||
mut commands: Commands,
|
||||
inwalls: Single<&WallTiles>,
|
||||
walltiles: Single<Entity, With<WallTiles>>,
|
||||
) -> Result {
|
||||
let hand = inwalls.iter().collect::<Vec<_>>();
|
||||
|
||||
commands
|
||||
.get_entity(*walltiles)?
|
||||
.remove_children(hand.last_chunk::<13>().unwrap());
|
||||
|
||||
commands.spawn((Hand, HandTiles(hand)));
|
||||
|
||||
trace!("dealt hands");
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue