412413414415416417418419420421422423
assert unit != null; assert nation != null; if (unit.getOwner() != null) { Nation prevNation = unit.getOwner(); prevNation.removeUnit(unit); } unit.setOwner(nation); nation.addUnit(unit); }
933934935936937938939940941942943944
assert city != null; Field field = city.getField(); field.removeMapObject(city); Nation owner = city.getOwner(); if (owner != null) { owner.removeCity(city); } game.remove(city); }
956957958959960961962963964965966967
assert city != null; assert nation != null; if (city.getOwner() != null) { Nation prevOwner = city.getOwner(); prevOwner.removeCity(city); } city.setOwner(nation); nation.addCity(city); }
10681069107010711072107310741075
public boolean isFieldOwnerAvailable(Coordinate position) { return true; } public Long getFieldOwner(Coordinate position) { Nation owner = getField(position).getOwner(); return (owner != null ? owner.getID() : null); }