public void AddStack(UnitsStack other) { if (Size > 5) { throw new Exception("Failed to add Stack to army"); } _army[Size] = new BattleUnitsStack(other); Size++; }
public BattleArmy(Army pattern) { IsDefeated = false; _army = new BattleUnitsStack[6]; Size = pattern.Size; UnitsStack[] tmp = pattern.GetArmy(); for (int i = 0; i < Size; i++) { _army[i] = new BattleUnitsStack(tmp[i]); } for (int i = Size; i < 6; i++) { _army[i] = new BattleUnitsStack(); } }
public void TakeAttack(BattleUnitsStack attacker, int num) { _army[num].TakeAttack(attacker); }