public AddStackCommand(TurnCounter counter, List <Unit> units, BattleArmy armyFirst, BattleArmy armySecond) { this.counter = counter; this.units = units; this.armyFirst = armyFirst; this.armySecond = armySecond; }
public void Escape() { state = BattleState.FINISHED; if (currentArmy.Equals(Second)) { winner = First; } else { winner = Second; } }
private void onMove() { if (currentArmy == null || currentArmy == Second) { currentArmy = First; } else { currentArmy = Second; } Queue = new BattleQueue(currentArmy.Stacks); CurrentStack = Queue?.First(); }
public Menu(IEnumerable <Unit> units) { ArmyFirst = new BattleArmy(); ArmySecond = new BattleArmy(); Units = units.ToList(); game = new Battle(ArmyFirst, ArmySecond); counter = new TurnCounter(); fsm = new FiniteStateMachine(); // General commands AddCommand("help", new HelpCommand(commands)); AddCommand("list", new ListUnitsCommand(Units)); AddCommand("army", new ListArmyCommand(counter, ArmyFirst, ArmySecond)); // Preparation commands AddStatefulCommand("add", new AddStackCommand(counter, Units, ArmyFirst, ArmySecond), new[] {
public Battle(BattleArmy firstArmy, BattleArmy secondArmy) { First = firstArmy; Second = secondArmy; state = BattleState.STOPPED; }
public ListArmyCommand(TurnCounter counter, BattleArmy armyFirst, BattleArmy armySecond) { this.counter = counter; this.armyFirst = armyFirst; this.armySecond = armySecond; }