@Component public class CityEngine extends AbstractEngine
| Modifier and Type | Field and Description |
|---|---|
private AutomaticTradingEngine |
automaticTradingEngine |
private ch.sahits.game.openpatrician.model.city.impl.CitiesState |
citiesState |
private com.google.common.eventbus.AsyncEventBus |
clientServerEventBus |
private org.springframework.context.ApplicationContext |
context |
private ch.sahits.game.openpatrician.model.Date |
date |
private ch.sahits.game.openpatrician.model.GameFactory |
gameFactory |
private LoanerEngine |
loanerEngine |
private int |
numberOfTicks
Number of ticks that need to waited untill
WARE_UPDATES_MINUTES |
private Random |
rnd |
private com.google.common.eventbus.AsyncEventBus |
serverEventBus |
private ShipyardEngine |
shipyardEngine |
private static byte |
STARTED
State indicating that the engine is properly initialized
|
private byte |
state
State of the engine
|
private static byte |
STOPPED
State indicating that the engine is not ready
|
private Map<ch.sahits.game.openpatrician.model.city.ICity,TavernEngine> |
tavernEngines |
private IJavaFXApplicationThreadExecution |
threadExecutor |
private int |
tickCounter
Counter that counts the ticks
|
private static int |
WARE_UPDATES_MINUTES
Update the ware consumed and produced every 12h
|
| Constructor and Description |
|---|
CityEngine() |
| Modifier and Type | Method and Description |
|---|---|
private void |
addCity(ch.sahits.game.openpatrician.model.city.ICity city)
Add a new city to the engine
|
List<AbstractEngine> |
getChildren()
Any engine may hold various child engines.
|
(package private) int |
getNumberOfTicks() |
ShipyardEngine |
getShipyardEngine() |
void |
handleClockTicked(ClockTick event) |
void |
handleClockTickIntervallChange(ClockTickIntervalChange event) |
void |
initialize() |
private void |
produceAndConsumeWares()
Compute the consume and production of wares of each city
|
void |
start(ch.sahits.game.openpatrician.model.IGame game)
Start the engine.
|
@Autowired private Random rnd
@Autowired private org.springframework.context.ApplicationContext context
@Autowired private ShipyardEngine shipyardEngine
private static final int WARE_UPDATES_MINUTES
private int numberOfTicks
WARE_UPDATES_MINUTESprivate int tickCounter
private static final byte STOPPED
private static final byte STARTED
private byte state
@Autowired private ch.sahits.game.openpatrician.model.Date date
@Autowired private ch.sahits.game.openpatrician.model.city.impl.CitiesState citiesState
@Autowired @Qualifier(value="serverClientEventBus") private com.google.common.eventbus.AsyncEventBus clientServerEventBus
@Autowired @Qualifier(value="serverEventBus") private com.google.common.eventbus.AsyncEventBus serverEventBus
@Autowired private ch.sahits.game.openpatrician.model.GameFactory gameFactory
@Autowired @Qualifier(value="javaFXApplicationThreadExecution") private IJavaFXApplicationThreadExecution threadExecutor
private Map<ch.sahits.game.openpatrician.model.city.ICity,TavernEngine> tavernEngines
@Autowired private AutomaticTradingEngine automaticTradingEngine
@Autowired private LoanerEngine loanerEngine
@PostConstruct public void initialize()
public void handleClockTickIntervallChange(ClockTickIntervalChange event)
int getNumberOfTicks()
public void handleClockTicked(ClockTick event)
private void produceAndConsumeWares()
private void addCity(ch.sahits.game.openpatrician.model.city.ICity city)
city - public void start(ch.sahits.game.openpatrician.model.IGame game)
public List<AbstractEngine> getChildren()
AbstractEnginegetChildren in class AbstractEnginepublic ShipyardEngine getShipyardEngine()
Copyright © 2011-2015 Sahits GmbH. All Rights Reserved.