DEVELOPMENT ENVIRONMENT

~liljamo/deck-builder

d218ec7502813c2451489eb8043e89a3b583e7c2 — Jonni Liljamo 1 year, 4 months ago 49a7a70
feat(client): reflect some gamestatus stuff
2 files changed, 7 insertions(+), 4 deletions(-)

M client/src/game_status/mod.rs
M client/src/plugins/game/mod.rs
M client/src/game_status/mod.rs => client/src/game_status/mod.rs +7 -3
@@ 6,6 6,7 @@
 * See LICENSE for licensing information.
 */

use bevy::prelude::*;
use std::collections::HashMap;

use serde::{Deserialize, Serialize};


@@ 70,15 71,18 @@ pub struct PlayerStatus {
}

/// constructed from a vector of [`Action`]s
#[derive(Clone)]
#[derive(Clone, Reflect, FromReflect)]
pub struct GameStatus {
    /// log entries, filled in one at a time when parsing actions
    pub log: Vec<LogEntry>,
    /// a modifiable Actions Vector, will be modified when parsing actions,
    /// used for showing the log
    #[reflect(ignore)]
    pub actions: Vec<Action>,
    #[reflect(ignore)]
    pub supply_piles: Vec<SupplyPile>,
    /// player ids mapped to statuses
    #[reflect(ignore)]
    pub players: HashMap<String, PlayerStatus>,
}



@@ 91,7 95,7 @@ impl GameStatus {
    }
}

#[derive(Clone)]
#[derive(Clone, Reflect, FromReflect)]
pub struct LogEntry {
    pub sections: Vec<LogSection>,
}


@@ 104,7 108,7 @@ impl LogEntry {
    }
}

#[derive(Clone)]
#[derive(Clone, Reflect, FromReflect)]
pub enum LogSection {
    Normal(String),
    Bold(String),

M client/src/plugins/game/mod.rs => client/src/plugins/game/mod.rs +0 -1
@@ 50,7 50,6 @@ impl Plugin for GamePlugin {
#[reflect(Resource)]
pub struct GameData {
    pub game: Option<Game>,
    #[reflect(ignore)]
    pub game_status: Option<GameStatus>,

    pub locked: bool,