Esempio n. 1
0
 public bool IsAllyOf(Army army) => Army.IsAllyOf(army);
Esempio n. 2
0
 public abstract Province GiveUpTo(Army army);
Esempio n. 3
0
 public Province AttackedBy(Army another) => GiveUpTo(Army.AttackedBy(another));
Esempio n. 4
0
 public bool IsAllyOf(Army another) => another.IsControlledBy(PlayerId);
Esempio n. 5
0
        public Army AttackedBy(Army another)
        {
            var soldiers = Soldiers.AttackedBy(another.Soldiers);

            return(DefensePower >= another.AttackPower ? new Army(soldiers, player) : new Army(soldiers, another.player));
        }
Esempio n. 6
0
 public Army Join(Army another) => new Army(Soldiers.Add(another.Soldiers), player);
Esempio n. 7
0
 public Army Subtract(Army another) => new Army(Soldiers.Subtract(another.Soldiers), player);
Esempio n. 8
0
 public Province ReinforcedBy(Army another) => WithArmy(Army.Join(another));
Esempio n. 9
0
 public (Province, Dynamics.IAction[]) AttackedBy(Army another) => GiveUpTo(Army.AttackedBy(another));
Esempio n. 10
0
 public virtual Province StartMove(Province dest, Army army) => WithArmy(Army.Subtract(army));
Esempio n. 11
0
 public (Province, Dynamics.IAction[]) GiveUpTo(Army his_army)
 {
     return(WithArmy(his_army), new[] { Army.Lose(this), his_army.Gain(this) }.NotNull().ToArray());
 }
Esempio n. 12
0
 protected abstract Province WithArmy(Army army);