From d218ec7502813c2451489eb8043e89a3b583e7c2 Mon Sep 17 00:00:00 2001 From: Jonni Liljamo Date: Wed, 24 May 2023 10:10:38 +0300 Subject: [PATCH] feat(client): reflect some gamestatus stuff --- client/src/game_status/mod.rs | 10 +++++++--- client/src/plugins/game/mod.rs | 1 - 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/client/src/game_status/mod.rs b/client/src/game_status/mod.rs index b311543..49dfd8e 100644 --- a/client/src/game_status/mod.rs +++ b/client/src/game_status/mod.rs @@ -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, /// a modifiable Actions Vector, will be modified when parsing actions, /// used for showing the log + #[reflect(ignore)] pub actions: Vec, + #[reflect(ignore)] pub supply_piles: Vec, /// player ids mapped to statuses + #[reflect(ignore)] pub players: HashMap, } @@ -91,7 +95,7 @@ impl GameStatus { } } -#[derive(Clone)] +#[derive(Clone, Reflect, FromReflect)] pub struct LogEntry { pub sections: Vec, } @@ -104,7 +108,7 @@ impl LogEntry { } } -#[derive(Clone)] +#[derive(Clone, Reflect, FromReflect)] pub enum LogSection { Normal(String), Bold(String), diff --git a/client/src/plugins/game/mod.rs b/client/src/plugins/game/mod.rs index 6a58af2..5fa65a9 100644 --- a/client/src/plugins/game/mod.rs +++ b/client/src/plugins/game/mod.rs @@ -50,7 +50,6 @@ impl Plugin for GamePlugin { #[reflect(Resource)] pub struct GameData { pub game: Option, - #[reflect(ignore)] pub game_status: Option, pub locked: bool, -- 2.44.1