use spacetimedb::Identity; use spacetimedb::{SpacetimeType, table}; #[derive(Debug)] #[table(name = player, public)] pub struct Player { #[primary_key] pub identity: Identity, #[unique] #[auto_inc] pub id: u32, pub name: Option, #[index(btree)] pub lobby_id: u32, pub hand_id: u32, pub pond_id: u32, pub ready: bool, } #[table(name = bot)] pub struct Bot { #[primary_key] #[auto_inc] pub id: u32, #[index(btree)] pub lobby_id: u32, pub hand_id: u32, pub pond_id: u32, } #[derive(Debug, Clone, SpacetimeType)] pub enum PlayerOrBot { Player { id: u32 }, Bot { id: u32 }, }