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