use bevy::prelude::*; use crate::{ game::{player::Player /* wall::WallTiles */}, tiles::Tile, }; #[derive(Component)] pub struct Hand; // #[derive(Component, Default)] // enum SortHand { // #[default] // Unsorted, // Sort, // Manual, // } pub(crate) fn sort_hands( tiles: Populated<&Tile>, mut hands: Populated<&mut Children, (With, Changed)>, ) -> Result { for mut hand in hands { hand.sort_unstable_by_key(|e| tiles.get(*e).unwrap().suit); debug!("sorted: {hand:?}") } trace!("sort_hands"); Ok(()) }