DEVELOPMENT ENVIRONMENT

~liljamo/deck-builder

cbfbc57d1ca8db12bd08bccdc24c62b62ff34b09 — Jonni Liljamo 1 year, 4 months ago 7981ec0
feat(client): add more log configurations
1 files changed, 27 insertions(+), 0 deletions(-)

M client/src/util/action_to_log.rs
M client/src/util/action_to_log.rs => client/src/util/action_to_log.rs +27 -0
@@ 13,6 13,7 @@ pub fn action_to_log(
    game_status: &GameStatus,
) -> LogEntry {
    let invoker_name = &game_status.players.get(&action.invoker).unwrap().display_name;
    let target_name = &game_status.players.get(&action.target).unwrap().display_name;

    match &action.command {
        Command::InitSupplyPile { card, amount } => {


@@ 56,6 57,32 @@ pub fn action_to_log(
                LogSection::bold(card_name),
            ])
        }
        Command::EndTurn {} => {
            LogEntry::from_sections(vec![
                LogSection::bold(invoker_name),
                LogSection::normal(" ended their turn"),
            ])
        }
        Command::StartTurn {} => {
            LogEntry::from_sections(vec![
                LogSection::bold(target_name),
                LogSection::normal(" started their turn"),
            ])
        }
        Command::ChangePlayerState { state } => {
            LogEntry::from_sections(vec![
                LogSection::bold(invoker_name),
                LogSection::normal(" changed state to "),
                LogSection::bold(&format!("{:?}", state)),
            ])
        }
        Command::RollForCurrency { min: _, max: _ } => {
            LogEntry::from_sections(vec![
                LogSection::bold(invoker_name),
                LogSection::normal(" rolled for currency (log borked)"),
            ])
        }
        #[allow(unreachable_patterns)]
        _ => {
            LogEntry {
                sections: vec![