@@ 13,7 13,10 @@ use crate::{api::game::{Action, Command}, game_status::SupplyPile};
use super::{GameStatus, PlayerStatus, Card};
-pub fn parse(actions: &Vec<Action>) -> Result<GameStatus, ()> {
+pub fn parse(actions_init: &Vec<Action>) -> Result<GameStatus, ()> {
+ // as some actions can add more actions, we need a mutable
+ // actions vector.
+ let mut actions = actions_init;
let mut game_status = GameStatus {
supply_piles: vec![],
players: HashMap::new(),
@@ 45,6 45,8 @@ pub fn ui(
details_ev_w.send(GameDetailsCallEvent {
game_id: game_data.game.as_ref().unwrap().id.clone(),
});
+
+ // somehow trigger ParseGameStatusEvent after fetched.
}
ui.separator();