public class City extends WareHolding implements ICity
occupiedSpaceProperty| Modifier and Type | Field and Description |
|---|---|
private List<IBuilding> |
buildings
Store the buildings in the city
|
private CityState |
cityState |
private javafx.geometry.Point2D |
coordinates |
private Date |
date |
private IWare[] |
effectiveProduction |
private IWare[] |
ineffectiveProduction |
private PlayerInteractionFactory |
interactionFactory |
private EKontorType |
kontorType |
private Locale |
locale |
private org.apache.log4j.Logger |
logger |
private org.springframework.context.MessageSource |
messageSource |
private Map<IWare,org.joda.time.DateTime> |
missingWares |
private String |
name |
private String |
nameTemplate |
private Map<IPlayer,Contributions> |
playersContributions
Store the contibutions of the players
|
private Map<EPopulationClass,javafx.beans.property.IntegerProperty> |
population
Holding the population split by population classes
|
private Map<IPlayer,IReputation> |
reputation
Map holding the reputation of the different players
|
private Random |
rnd |
private LateIntegerBinding |
totalPopulation |
| Constructor and Description |
|---|
City(City city) |
City(String configFileName)
This Constructor is used by tests
|
| Modifier and Type | Method and Description |
|---|---|
void |
build(IBuilding building)
Add a new building to the city
|
private int |
calculateInitialBeggarCount(int totalPopulation) |
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
|
Map<IWare,org.joda.time.DateTime> |
getMissingWares()
Retrieve the missing wares along with their times
|
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
|
List<IPlayer> |
getResidentPlayers()
Retrieve all the players that have a office in this city.
|
ESocialRank |
getSocialRank()
Retrieve the social rank in this city
|
String |
getUniqueID()
Retrieve the unique ID of the city.
|
private void |
init() |
private void |
initPopulation()
Initialize the population of the different classes based on the properties
|
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
|
private int |
internalPopulationCount()
Count the population.
|
int |
move(IWare ware,
int amount,
IPlayer player)
Move ware into this holding.
|
void |
moveIn(IPlayer player)
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
|
addNewWare, computeAVGPrice, containsWare, getOccupiedSpace, getWare, occupiedSpaceProperty, setOccupiedSpace, storedAmountBindingclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCityState, getCoordinates, getEffectiveProduction, getIneffectiveProduction, getKontorType, getName, getWare, setCityStateprivate final org.apache.log4j.Logger logger
@Autowired private Random rnd
private final IWare[] effectiveProduction
private final IWare[] ineffectiveProduction
private String name
private final String nameTemplate
private final EKontorType kontorType
@Autowired private PlayerInteractionFactory interactionFactory
@Autowired private Locale locale
@Autowired private org.springframework.context.MessageSource messageSource
private final javafx.geometry.Point2D coordinates
private Map<IPlayer,IReputation> reputation
private Map<IPlayer,Contributions> playersContributions
private final Map<EPopulationClass,javafx.beans.property.IntegerProperty> population
private LateIntegerBinding totalPopulation
private CityState cityState
@Autowired private Date date
public City(City city)
City(String configFileName) throws IOException
IOException@PostConstruct private void init()
protected void initWares()
private void initPopulation()
private int calculateInitialBeggarCount(int totalPopulation)
private int internalPopulationCount()
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 classpublic List<IBuilding> getBuildings()
ICitygetBuildings in interface ICitypublic void build(IBuilding building)
public void tearDown(IBuilding building)
public IReputation getReputation(IPlayer player)
ICitygetReputation in interface ICitypublic void moveIn(IPlayer player)
ICitypublic ESocialRank getSocialRank()
ICitygetSocialRank in interface ICitypublic int move(IWare ware, int amount, IPlayer 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 Map<IWare,org.joda.time.DateTime> getMissingWares()
ICitygetMissingWares in interface ICitypublic List<IPlayer> getResidentPlayers()
ICitygetResidentPlayers in interface ICitypublic String getUniqueID()
ICitygetUniqueID in interface ICityCopyright © 2011-2015 Sahits GmbH. All Rights Reserved.