Skip to main content

vitium_api/game/
mod.rs

1pub mod attr;
2pub mod components;
3pub mod fight;
4pub mod level;
5pub mod mart;
6pub mod mat;
7pub mod prelude;
8pub mod prof;
9pub mod race;
10pub mod skill;
11pub mod spell;
12pub mod terra;
13
14use serde::{Deserialize, Serialize};
15
16use crate::UId;
17
18pub use self::prelude::*;
19
20use std::collections::HashSet;
21
22#[derive(Clone, Copy, Serialize, Deserialize)]
23pub enum Obj {
24    Item(UId),
25    Char(UId),
26    PC(UId),
27    Scena(usize),
28    Vehicle(UId),
29}
30
31#[derive(Clone, Copy, Serialize, Deserialize)]
32pub enum Target {
33    Entity(Obj),
34    Pos(i16, i16),
35}
36
37/// Refers to the current game status.
38#[derive(Clone, Serialize, Deserialize)]
39pub struct GameStat {
40    /// Whether the game is ongoing now.
41    pub on: bool,
42    /// All player characters in this game.
43    pub chara: HashSet<String>,
44    /// Whether it has a finished turn now.
45    pub done: bool,
46    /// Whether the game has ended.
47    pub term: bool,
48    /// Turn number the game has reached.
49    pub turn: i64,
50    /// Host player of this game.
51    pub host: String,
52    /// Current mods loaded.
53    pub modlist: HashSet<String>,
54}