예제 #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);