private void MoveToNewTerritory(LandTerritory passedTerritory) { Infantry placeHolderInfantry; Knight placeHolderKnight; passedTerritory.setNumKnight(getAttackingKnights().Count); passedTerritory.setNumInfantry(getAttackingInfantry().Count); attacker.setNumKnight(attacker.getNumKnight() - getAttackingKnights().Count); attacker.setNumInfantry(attacker.getNumInfantry() - getAttackingInfantry().Count); passedTerritory.setHouseOccupied(attacker.getHouseOccupied()); passedTerritory.setOrderToken(new PlaceHolderOrderToken()); foreach(Knight k in getAttackingKnights()) { attacker.getKnights().Remove(k); passedTerritory.getKnights().Add(k); } foreach(Infantry i in getAttackingInfantry()) { attacker.getInfantry().Remove(i); passedTerritory.getInfantry().Add(i); } }
public void setHouseStartingLand(House house, LandTerritory land, int numInfantry, int numKnights, int numSiegeEngine) { List<Infantry> infantry = new List<Infantry>(); List<Knight> knight = new List<Knight>(); land.setHouseOccupied(house); land.setNumInfantry(numInfantry); for (int i = 0; i < numInfantry; i++) { infantry.Add(new Infantry()); } land.setInfantry(infantry); land.setNumKnight(numKnights); for (int i = 0; i < numKnights; i++) { knight.Add(new Knight()); } land.setKnights(knight); main.drawUnits.DrawIt(land); }