re-organize crates

This commit is contained in:
Tao Tien 2026-02-15 23:40:21 -08:00
parent 1afb7f4e3d
commit c709fb5851
50 changed files with 148 additions and 121 deletions

41
jong-line/src/tables.rs Normal file
View file

@ -0,0 +1,41 @@
use spacetimedb::table;
use jong_types::*;
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,
pub players: Vec<player::PlayerOrBot>,
pub dealer_idx: u8,
pub current_idx: u8,
pub game_state: GameState,
pub turn_state: TurnState,
}
#[table(name = wall)]
pub struct DbWall {
#[primary_key]
pub lobby_id: u32,
pub tiles: Vec<DbTile>,
}
#[table(name = tile)]
#[derive(Debug, Clone, Copy)]
pub struct DbTile {
#[primary_key]
#[auto_inc]
pub id: u32,
pub tile: jong_types::Tile,
}