Class Storage
- java.lang.Object
-
- ch.sahits.game.openpatrician.model.building.impl.Storage
-
-
Field Summary
Fields Modifier and Type Field Description private BuildingProperties
buildingProperties
private ICity
city
private javafx.beans.property.IntegerProperty
nbGuards
private IPlayer
owner
private javafx.beans.property.IntegerProperty
rentOutStorage
private com.google.common.eventbus.AsyncEventBus
timerEventBus
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javafx.beans.binding.IntegerBinding
costsPerDayBinding()
Retrieve the daily cost for rent storagevoid
destroy()
private int
getNbWareHouses()
Retrieve the number of warehousesjavafx.beans.binding.IntegerBinding
guardCostsPerDayBinding()
Retrieve the costs for the guardsvoid
handleDailyUpdate(ClockTickDayChange event)
private void
init()
private ELevel
internalSecurityLevelCalculation()
javafx.beans.property.IntegerProperty
numberGuardsProperty()
Retrieve the number of guardsjavafx.beans.property.IntegerProperty
rentOutStorageProperty()
Retrieve the amount of storage in barrels that is rented by someone elsejavafx.beans.binding.ObjectBinding<ELevel>
securityLevelBinding()
Retrieve the security levelvoid
updateGuardsNumber(int update)
Increase or decrease the number of guardsvoid
updateRendedSpace(int nbBarrels)
Update the rented out space
-
-
-
Field Detail
-
timerEventBus
@Autowired @Qualifier("timerEventBus") private com.google.common.eventbus.AsyncEventBus timerEventBus
-
buildingProperties
@Autowired private BuildingProperties buildingProperties
-
owner
private final IPlayer owner
-
city
private final ICity city
-
rentOutStorage
private javafx.beans.property.IntegerProperty rentOutStorage
-
nbGuards
private javafx.beans.property.IntegerProperty nbGuards
-
-
Method Detail
-
init
@PostConstruct private void init()
-
destroy
@PreDestroy public void destroy()
-
getNbWareHouses
private int getNbWareHouses()
Retrieve the number of warehouses- Returns:
- number of warehouses.
-
rentOutStorageProperty
public javafx.beans.property.IntegerProperty rentOutStorageProperty()
Description copied from interface:IStorage
Retrieve the amount of storage in barrels that is rented by someone else- Specified by:
rentOutStorageProperty
in interfaceIStorage
- Returns:
- integer property for rented out storage
-
updateRendedSpace
public void updateRendedSpace(int nbBarrels)
Description copied from interface:IStorage
Update the rented out space- Specified by:
updateRendedSpace
in interfaceIStorage
- Parameters:
nbBarrels
- rented out space in barrels
-
costsPerDayBinding
public javafx.beans.binding.IntegerBinding costsPerDayBinding()
Description copied from interface:IStorage
Retrieve the daily cost for rent storage- Specified by:
costsPerDayBinding
in interfaceIStorage
- Returns:
- integer binding of daily costs for renting additional space.
-
numberGuardsProperty
public javafx.beans.property.IntegerProperty numberGuardsProperty()
Description copied from interface:IStorage
Retrieve the number of guards- Specified by:
numberGuardsProperty
in interfaceIStorage
- Returns:
- IntegerProperty for number of guards.
-
guardCostsPerDayBinding
public javafx.beans.binding.IntegerBinding guardCostsPerDayBinding()
Description copied from interface:IStorage
Retrieve the costs for the guards- Specified by:
guardCostsPerDayBinding
in interfaceIStorage
- Returns:
- IntegerBinding for guard salary per day.
-
securityLevelBinding
public javafx.beans.binding.ObjectBinding<ELevel> securityLevelBinding()
Description copied from interface:IStorage
Retrieve the security level- Specified by:
securityLevelBinding
in interfaceIStorage
- Returns:
- object binding of security level
-
internalSecurityLevelCalculation
private ELevel internalSecurityLevelCalculation()
-
updateGuardsNumber
public void updateGuardsNumber(int update)
Description copied from interface:IStorage
Increase or decrease the number of guards- Specified by:
updateGuardsNumber
in interfaceIStorage
- Parameters:
update
- delta in the number of guards.
-
handleDailyUpdate
public void handleDailyUpdate(ClockTickDayChange event)
-
-