Class BlockadeEngine
- java.lang.Object
-
- ch.sahits.game.openpatrician.engine.AbstractEngine
-
- ch.sahits.game.openpatrician.engine.sea.BlockadeEngine
-
@Lazy @Service @DependentInitialisation(StartNewGameBean.class) public class BlockadeEngine extends AbstractEngine
Engine handling the blockade.- Author:
- Andi Hotz, (c) Sahits GmbH, 2016 Created on Apr 14, 2016
-
-
Field Summary
Fields Modifier and Type Field Description private BlockadeState
blockadeState
private com.google.common.eventbus.AsyncEventBus
clientServerEventBus
private org.springframework.context.ApplicationContext
context
private Date
date
private GuildList
guildList
private GuildService
guildService
private MapService
mapService
private ModelFactory
modelFactory
private IModelTranslationService
modelTranslationService
private PlayerList
players
private java.util.Random
rnd
private SeafaringService
seafaringService
private SeaFightService
seafightService
private ShipFactory
shipFactory
-
Constructor Summary
Constructors Constructor Description BlockadeEngine()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
createConvoy(IBlockade blockade, ICity city)
private void
destroy()
(package private) void
dissolveConvoy(IBlockade blockade, ICity city, ICity blockadedCity)
java.util.List<AbstractEngine>
getChildren()
Any engine may hold various child engines.void
handleBlockadeConvoyReturns(ShipEntersPortEvent event)
void
handleDailyUpdate(PeriodicalDailyUpdate dayChange)
void
handleShipBreaksBlockade(ShipNearingPortEvent event)
private void
initialize()
void
initializeNewBlockade(ICity city)
-
-
-
Field Detail
-
clientServerEventBus
@Autowired @Qualifier("serverClientEventBus") private com.google.common.eventbus.AsyncEventBus clientServerEventBus
-
blockadeState
@Autowired private BlockadeState blockadeState
-
shipFactory
@Autowired private ShipFactory shipFactory
-
date
@Autowired private Date date
-
rnd
@Autowired private java.util.Random rnd
-
context
@Autowired private org.springframework.context.ApplicationContext context
-
players
@Autowired private PlayerList players
-
seafaringService
@Autowired private SeafaringService seafaringService
-
seafightService
@Autowired private SeaFightService seafightService
-
modelTranslationService
@Autowired private IModelTranslationService modelTranslationService
-
mapService
@Autowired private MapService mapService
-
modelFactory
@Autowired private ModelFactory modelFactory
-
guildList
@Autowired private GuildList guildList
-
guildService
@Autowired private GuildService guildService
-
-
Method Detail
-
getChildren
public java.util.List<AbstractEngine> getChildren()
Description copied from class:AbstractEngine
Any engine may hold various child engines. This is the way to retrieve them. If there are no child engines, return an empty list. Subclasses have to implement this in the proper way.- Specified by:
getChildren
in classAbstractEngine
- Returns:
- list of child engines.
-
initialize
@PostConstruct private void initialize()
-
destroy
@PreDestroy private void destroy()
-
initializeNewBlockade
public void initializeNewBlockade(ICity city)
-
handleDailyUpdate
public void handleDailyUpdate(PeriodicalDailyUpdate dayChange)
-
handleShipBreaksBlockade
public void handleShipBreaksBlockade(ShipNearingPortEvent event)
-
handleBlockadeConvoyReturns
public void handleBlockadeConvoyReturns(ShipEntersPortEvent event)
-
-