ICity@Component
@Scope("prototype")
public class City
extends WareHolding
implements ICity
| Modifier and Type | Field | Description |
|---|---|---|
protected com.google.common.collect.Interner<javafx.geometry.Point2D> |
pointInterner |
computablePrice| Constructor | Description |
|---|---|
City(ch.sahits.game.openpatrician.data.xmlmodel.map.Map.Cities.City city) |
|
City(FoundNewSettlement futureTown) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
addBuildingPermission(IPlayer player) |
Add the bulidng permission for that player in the city.
|
void |
build(IBuilding building) |
Add a new building to the city
|
boolean |
equals(java.lang.Object o) |
|
<T extends IBuilding> |
findBuilding(java.lang.Class<T> buildingClass,
java.util.Optional<IPlayer> owner) |
Find all matching buildings in a city.
|
java.util.List<IBuilding> |
getBuildings() |
Retrieve a list of all buildings in the city.
|
int |
getContribution(IPlayer player,
IWare ware) |
Check out what the player contributed to the ware
|
java.util.Map<IWare,java.time.LocalDateTime> |
getMissingWares() |
Retrieve the missing wares along with their times
|
double |
getPercentageRoad() |
Retrieve the amount of road in the city.
|
int |
getPopulation(EPopulationClass popclass) |
Retrieve the population count for a class
|
javafx.beans.binding.IntegerBinding |
getPopulationBinding() |
Retrieve the binding of the city's total population.
|
javafx.beans.property.IntegerProperty |
getPopulationProperty(EPopulationClass popclass) |
Retrieve the population count for a class
|
IReputation |
getReputation(IPlayer player) |
Retrieve the reputation of the player in the city
|
java.util.List<IPlayer> |
getResidentPlayers() |
Retrieve all the players that have a office in this city.
|
java.lang.String |
getUniqueID() |
Retrieve the unique ID of the city.
|
boolean |
hasBuildingPermission(IPlayer player) |
The player has building permission in this city.
|
int |
hashCode() |
|
protected void |
initWares() |
Init the amount of wares available in the city
This method is protected so it can be overriden by subclasses for testing
|
int |
move(IWare ware,
int amount,
ICitizen player) |
Move ware into this holding.
|
void |
moveIn(IPlayer player,
IReputation reputaion,
Contributions contributions) |
Add a player to the city
|
void |
setPopulation(int population,
EPopulationClass popClass) |
Set the population count for a apopulation class
|
void |
tearDown(IBuilding building) |
Remove a building from the list of buildings in the city
|
getCitizen, getCityState, getCoordinates, getEffectiveProduction, getImported, getIneffectiveProduction, getKontorType, getName, getNameTemplate, getWare, isRiverCity, setCityStateclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitaddNewWare, bindStoredAmount, computeAVGPrice, containsWare, getOccupiedSpace, getWare, occupiedSpaceProperty, setOccupiedSpace, storedAmountBinding, unbindAllAmounts@Autowired protected com.google.common.collect.Interner<javafx.geometry.Point2D> pointInterner
public City(ch.sahits.game.openpatrician.data.xmlmodel.map.Map.Cities.City city)
public City(FoundNewSettlement futureTown)
protected void initWares()
public javafx.beans.binding.IntegerBinding getPopulationBinding()
ICitygetPopulationBinding in interface ICitypublic void setPopulation(int population,
EPopulationClass popClass)
setPopulation in interface ICitypopulation - countpopClass - population classpublic int getPopulation(EPopulationClass popclass)
getPopulation in interface ICitypopclass - population classpublic javafx.beans.property.IntegerProperty getPopulationProperty(EPopulationClass popclass)
ICitygetPopulationProperty in interface ICitypopclass - population classpopclasspublic java.util.List<IBuilding> getBuildings()
ICitygetBuildings in interface ICitypublic void build(IBuilding building)
public void tearDown(IBuilding building)
public IReputation getReputation(IPlayer player)
ICitygetReputation in interface ICityplayer - for whom to retrieve the reputationpublic void moveIn(IPlayer player, IReputation reputaion, Contributions contributions)
ICitypublic int move(IWare ware, int amount, ICitizen player)
move in interface ICitymove in class WareHoldingware - to be movedamount - of the ware that is movedplayer - that initiates the moving, may be null, e.g. if the moving is initiated by a citypublic int getContribution(IPlayer player, IWare ware)
ICitygetContribution in interface ICityplayer - whose contribution is to be checkedware - that is checked for contributionpublic java.util.Map<IWare,java.time.LocalDateTime> getMissingWares()
ICitygetMissingWares in interface ICitypublic java.util.List<IPlayer> getResidentPlayers()
ICitygetResidentPlayers in interface ICitypublic java.lang.String getUniqueID()
ICitygetUniqueID in interface ICitypublic <T extends IBuilding> java.util.List<T> findBuilding(java.lang.Class<T> buildingClass, java.util.Optional<IPlayer> owner)
ICityfindBuilding in interface ICitybuildingClass - class of the buildingowner - search can be restricted to a player.public boolean hasBuildingPermission(IPlayer player)
ICityhasBuildingPermission in interface ICityplayer - for whom to check building permissionplayer has building permission.public void addBuildingPermission(IPlayer player)
ICityaddBuildingPermission in interface ICityplayer - for whom to add a building permissionpublic double getPercentageRoad()
ICitygetPercentageRoad in interface ICitypublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.ObjectCopyright © 2011-2018 Sahits GmbH. All Rights Reserved.