@Component @Lazy @DependentInitialisation(value=ch.sahits.game.openpatrician.util.MapInitializedBean.class) public class CityEngine extends AbstractEngine
| Modifier and Type | Field and Description |
|---|---|
private AutomaticTradingEngine |
automaticTradingEngine |
private ChurchEngine |
churchEngine |
private ch.sahits.game.openpatrician.model.city.impl.CitiesState |
citiesState |
private CityHallEngine |
cityHallEngine |
private ch.sahits.game.openpatrician.model.city.CityProductionStorage |
cityProductionStorage |
private com.google.common.eventbus.AsyncEventBus |
clientServerEventBus |
private org.springframework.context.ApplicationContext |
context |
private ch.sahits.game.openpatrician.model.Date |
date |
private GameFactory |
gameFactory |
private GuildEngine |
guildEngine |
private LoanerEngine |
loanerEngine |
private org.apache.logging.log4j.Logger |
logger |
private int |
numberOfTicks
Number of ticks that need to waited untill
WARE_UPDATES_MINUTES |
private PlayerEngine |
playerEngine |
private CityProductionAndConsumptionService |
productionAndConsumtionService |
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 ServerSideTaskFactory |
taskFactory |
private ch.sahits.game.openpatrician.model.event.TimedUpdatableTaskList |
taskList |
private TavernEngine |
tavernEngine |
private ch.sahits.game.openpatrician.util.javafx.IJavaFXApplicationThreadExecution |
threadExecutor |
private int |
tickCounter
Counter that counts the ticks
|
private com.google.common.eventbus.AsyncEventBus |
timerEventBus |
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
|
private void |
consumeWares()
Compute the consume of wares of each city
|
TavernEngine |
findTavernEngine()
Find the tafern engine for the matching city.
|
List<AbstractEngine> |
getChildren()
Any engine may hold various child engines.
|
(package private) int |
getNumberOfTicks() |
ShipyardEngine |
getShipyardEngine() |
void |
handleCityAdd(ch.sahits.game.openpatrician.model.event.FoundingCityBecomesAccessible event)
Handle the event where a new city is added to the map.
|
void |
handleClockTicked(ClockTick event) |
void |
handleClockTickIntervallChange(ClockTickIntervalChange event) |
void |
initialize() |
void |
start(ch.sahits.game.openpatrician.model.IGame game)
Start the engine.
|
private void |
unregister() |
private final org.apache.logging.log4j.Logger logger
@Autowired private Random rnd
@Autowired private org.springframework.context.ApplicationContext context
@Autowired private ShipyardEngine shipyardEngine
@Autowired private ch.sahits.game.openpatrician.model.event.TimedUpdatableTaskList taskList
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 @Qualifier(value="timerEventBus") private com.google.common.eventbus.AsyncEventBus timerEventBus
@Autowired @Qualifier(value="javaFXApplicationThreadExecution") private ch.sahits.game.openpatrician.util.javafx.IJavaFXApplicationThreadExecution threadExecutor
@Autowired private CityProductionAndConsumptionService productionAndConsumtionService
@Autowired private AutomaticTradingEngine automaticTradingEngine
@Autowired private LoanerEngine loanerEngine
@Autowired private CityHallEngine cityHallEngine
@Autowired private PlayerEngine playerEngine
@Autowired private ChurchEngine churchEngine
@Autowired private TavernEngine tavernEngine
@Autowired private GuildEngine guildEngine
@Autowired private GameFactory gameFactory
@Autowired private ch.sahits.game.openpatrician.model.city.CityProductionStorage cityProductionStorage
@Autowired private ServerSideTaskFactory taskFactory
@PostConstruct public void initialize()
@PreDestroy private void unregister()
public void handleClockTickIntervallChange(ClockTickIntervalChange event)
int getNumberOfTicks()
public void handleClockTicked(ClockTick event)
private void consumeWares()
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()
public TavernEngine findTavernEngine()
public void handleCityAdd(ch.sahits.game.openpatrician.model.event.FoundingCityBecomesAccessible event)
event - Copyright © 2011-2017 Sahits GmbH. All Rights Reserved.