This commit is contained in:
Tao Tien 2026-01-09 06:54:17 -08:00
parent 78029687d7
commit bea146d439
9 changed files with 88 additions and 41 deletions

View file

@ -1,24 +1,22 @@
use bevy::{ecs::entity::MapEntities, prelude::*};
use strum::FromRepr;
// #[derive(Component)]
// #[derive(relasionship(re))]
// pub struct TileEntity {
// #[relationship]
// pub parent: Entity,
// r#type: Tile,
// }
struct Hand;
use crate::game::wall::Wall;
#[derive(Component)]
#[relationship(relationship_target = Wall)]
pub struct InWall(pub Entity);
// #[derive(Component)]
// #[relationship(relationship_target = WallTiles)]
// pub(crate) struct InHand(pub Entity);
#[derive(Component, Debug)]
pub struct Tile {
suit: Suit,
}
#[derive(MapEntities)]
#[derive(MapEntities, Debug)]
pub enum Suit {
Pin(Rank),
Sou(Rank),
@ -27,10 +25,10 @@ pub enum Suit {
Dragon(Dragon),
}
#[derive(Deref, DerefMut)]
#[derive(Deref, DerefMut, Debug)]
pub struct Rank(u8);
#[derive(FromRepr)]
#[derive(FromRepr, Debug)]
pub enum Wind {
Ton,
Nan,
@ -38,7 +36,7 @@ pub enum Wind {
Pei,
}
#[derive(FromRepr)]
#[derive(Debug, FromRepr)]
pub enum Dragon {
Haku,
Hatsu,