Ejemplo n.º 1
0
        private void HandleCombatOutcomeChanged(CombatOutcome outcome)
        {
            switch (outcome)
            {
            case CombatOutcome.None:
                _outcomeDisplayString.Value = string.Empty;
                break;

            case CombatOutcome.EnemyReachedBase:
                _outcomeDisplayString.Value = "the enemy reached your base";
                break;

            case CombatOutcome.NoMoreLives:
                _outcomeDisplayString.Value = "no more lives";
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(outcome), outcome, null);
            }
        }
        private static IUnitCombat StubCombat(IUnit attacker, IUnit defender, CombatOutcome fixedOutcome)
        {
            var stubCombat = A.Fake<IUnitCombat>();

            A.CallTo(() => stubCombat.CombatOutcome(A<IUnit>.That.Matches(unit => unit.Id == attacker.Id),
                                                    A<IUnit>.That.Matches(unit => unit.Id == defender.Id)))
             .Returns(fixedOutcome);

            return stubCombat;
        }
Ejemplo n.º 3
0
 public CombatLogEntry()
 {
     CombatEffect = new CombatOutcome();
 }
Ejemplo n.º 4
0
 private void EndGame(CombatOutcome outcome)
 {
     _sessionModel.Outcome.Value = outcome;
     ChangeState(CombatState.GameOver);
     DOVirtual.DelayedCall(2f, () => ChangeState(CombatState.AfterCombatScreen));
 }
Ejemplo n.º 5
0
 public CombatResult(CombatOutcome outc, string msg)
 {
     Message = msg;
     Outcome = outc;
 }