jong/spacetimedb/src/tables.rs

42 lines
713 B
Rust
Raw Normal View History

2026-02-11 10:14:02 -08:00
use spacetimedb::{Filter, SpacetimeType, client_visibility_filter, table};
use jong_types::*;
2026-02-11 10:14:02 -08:00
pub mod player;
pub use player::*;
#[derive(Debug, Clone)]
#[table(name = lobby, public)]
pub struct Lobby {
#[primary_key]
#[auto_inc]
pub id: u32,
#[unique]
pub host_player_id: u32,
2026-02-11 10:14:02 -08:00
pub players: Vec<player::PlayerOrBot>,
pub game_state: GameState,
2026-02-10 01:40:13 -08:00
pub turn_state: TurnState,
2026-02-13 07:49:09 -08:00
// pub dealt_idx: i8,
}
#[table(name = wall)]
2026-02-12 17:06:28 -08:00
pub struct DbWall {
#[primary_key]
pub lobby_id: u32,
2026-02-12 17:06:28 -08:00
pub tiles: Vec<DbTile>,
}
#[table(name = tile)]
2026-02-13 07:49:09 -08:00
#[derive(Debug, Clone, Copy)]
2026-02-12 17:06:28 -08:00
pub struct DbTile {
#[primary_key]
#[auto_inc]
pub id: u32,
pub tile: jong_types::Tile,
}