render main player's hand

This commit is contained in:
Tao Tien 2026-01-13 01:08:14 -08:00
parent 30d19ed9d9
commit 314c3299ef
8 changed files with 134 additions and 97 deletions

View file

@ -1,4 +1,4 @@
use bevy::prelude::*;
use bevy::{ecs::relationship::RelationshipSourceCollection, prelude::*};
use crate::{
game::{player::Player /* wall::WallTiles */},
@ -18,12 +18,11 @@ pub struct Hand;
pub(crate) fn sort_hands(
tiles: Populated<&Tile>,
mut hands: Populated<&mut Children, (With<Player>, Changed<Hand>)>,
mut hands: Populated<&mut Children, (Changed<Hand>, Without<Player>)>,
) -> Result {
for mut hand in hands {
hand.sort_unstable_by_key(|e| tiles.get(*e).unwrap().suit);
debug!("sorted: {hand:?}")
debug!("sorted: {hand:?}");
}
trace!("sort_hands");
Ok(())
}