@Component
@Scope("prototype")
public class CityState
extends java.lang.Object
| Constructor | Description |
|---|---|
CityState(ICity city,
IShipyard shipard,
TavernState tavern) |
| Modifier and Type | Method | Description |
|---|---|---|
javafx.beans.property.ObjectProperty<ECityState> |
cityEventProperty() |
Property holding the corrent city event, may be null.
|
java.util.Set<java.util.Map.Entry<IWare,java.lang.Double>> |
consumedEntries() |
Get the consumed entries as a set.
|
void |
dailyUpdate(ClockTickPostDayChange dayChange) |
Update the missing wares.
|
javafx.beans.binding.BooleanBinding |
famineBinding() |
Binding indicating if there is a famine.
|
java.util.Optional<IWare> |
findMostNeededWare() |
Find the ware which is consumed the most and which is missing for the longest time.
|
java.util.Optional<IWare> |
findWareWithMostSurplus() |
Find the ware that the city sells near the minimal price.
|
double |
getConsumedAmount(EWare ware) |
Retrieve the amount that is consumed so far.
|
javafx.beans.binding.ObjectBinding<IWare> |
longestMissingWaresBinding() |
Retrieve the ware that is missing the longest.
|
void |
replaceConsumedAmount(IWare ware,
double amount) |
Set the amount of the ware that is consumed.
|
public CityState(ICity city, IShipyard shipard, TavernState tavern)
public void dailyUpdate(ClockTickPostDayChange dayChange)
dayChange - event indicating a day changepublic javafx.beans.binding.ObjectBinding<IWare> longestMissingWaresBinding()
public javafx.beans.binding.BooleanBinding famineBinding()
public javafx.beans.property.ObjectProperty<ECityState> cityEventProperty()
public java.util.Set<java.util.Map.Entry<IWare,java.lang.Double>> consumedEntries()
public void replaceConsumedAmount(IWare ware, double amount)
ware - to be consumedamount - to be consumedpublic double getConsumedAmount(EWare ware)
ware - which should be checked for consumption.public java.util.Optional<IWare> findMostNeededWare()
public java.util.Optional<IWare> findWareWithMostSurplus()
Copyright © 2011-2018 Sahits GmbH. All Rights Reserved.