use bevy::{ecs::relationship::RelationshipSourceCollection, 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, (Changed, Without)>, ) -> Result { for mut hand in hands { hand.sort_unstable_by_key(|e| tiles.get(*e).unwrap().suit); debug!("sorted: {hand:?}"); } Ok(()) }