Example #1
0
    private void _on_Infection_DiceRolled(string rolledValue)
    {
        var selectedPlayer = (Player)Map.GetSelectedNode();
        var currentMove    = _movementManager.CurrentPlayerMove;

        var infectionDice = _diceManager.GetInfectionDice();

        infectionDice.HideDice();

        _movementManager.ProcessInfectionOutput(rolledValue, (string text) =>
        {
            _displayText.SetText($"[center]{text}[/center]");
            _displayText.Display();

            if (HasEnemyUnit(currentMove.Position.Column, currentMove.Position.Row, selectedPlayer.GetPlayerNumber(), out var enemy))
            {
                _playerManager.KillUnit(enemy);
                _victoryManager.CheckIfHasNoHumanPlayers();
                _victoryManager.CheckForVictory();
            }

            return(1);
        },
                                                (string text) =>
        {
            _displayText.SetText($"[center]{text}[/center]");
            _displayText.Display();

            return(1);
        });

        selectedPlayer.SetAP(selectedPlayer.AP - currentMove.APWeight, emitSignal: true);
    }