Пример #1
0
 public bool IsAllyOf(Army army) => Army.IsAllyOf(army);
Пример #2
0
 public abstract Province GiveUpTo(Army army);
Пример #3
0
 public Province AttackedBy(Army another) => GiveUpTo(Army.AttackedBy(another));
Пример #4
0
 public bool IsAllyOf(Army another) => another.IsControlledBy(PlayerId);
Пример #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));
        }
Пример #6
0
 public Army Join(Army another) => new Army(Soldiers.Add(another.Soldiers), player);
Пример #7
0
 public Army Subtract(Army another) => new Army(Soldiers.Subtract(another.Soldiers), player);
Пример #8
0
 public Province ReinforcedBy(Army another) => WithArmy(Army.Join(another));
Пример #9
0
 public (Province, Dynamics.IAction[]) AttackedBy(Army another) => GiveUpTo(Army.AttackedBy(another));
Пример #10
0
 public virtual Province StartMove(Province dest, Army army) => WithArmy(Army.Subtract(army));
Пример #11
0
 public (Province, Dynamics.IAction[]) GiveUpTo(Army his_army)
 {
     return(WithArmy(his_army), new[] { Army.Lose(this), his_army.Gain(this) }.NotNull().ToArray());
 }
Пример #12
0
 protected abstract Province WithArmy(Army army);