@Lazy @Service @DependentInitialisation(value=ch.sahits.game.openpatrician.util.StartNewGameBean.class) public class PirateEngine extends AbstractEngine
| Modifier and Type | Field and Description |
|---|---|
private AStarHeuristicProvider |
aStarHeuristicProvider |
private MapService |
cityService |
private com.google.common.eventbus.AsyncEventBus |
clientServerEventBus |
private ch.sahits.game.openpatrician.model.Date |
date |
private static ch.sahits.game.openpatrician.util.RandomNameLoader |
firstNameLoader |
private boolean |
graphInitialized |
private static ch.sahits.game.openpatrician.util.RandomNameLoader |
lastNameLoader |
private LocationTracker |
locationTracker |
private org.apache.logging.log4j.Logger |
logger |
private ch.sahits.game.openpatrician.model.map.IMap |
map |
private IMapImageServiceFacade |
mapService |
private PeopleFactory |
peopleFactory |
private ch.sahits.game.openpatrician.model.people.impl.SeaPiratesState |
piratesState |
private Random |
rnd |
private ScheduledExecutorService |
schedulableServerThreadPool |
private SeafaringService |
seafaringService |
private SeaFightService |
seaFightService |
private ShipFactory |
shipFactory |
private static ch.sahits.game.openpatrician.util.RandomNameLoader |
shipLoader |
private ShipyardEngine |
shipyardEngine |
private com.google.common.eventbus.EventBus |
syncServerClientEventBus |
private com.google.common.eventbus.AsyncEventBus |
timerEventBus |
| Constructor and Description |
|---|
PirateEngine() |
| Modifier and Type | Method and Description |
|---|---|
private ch.sahits.game.openpatrician.model.ship.IShip |
createInitialPiratesShip()
Create a ship for the pirate
|
private void |
destroy() |
private ch.sahits.game.openpatrician.model.weapon.EWeapon |
getBigWeaponType() |
List<AbstractEngine> |
getChildren()
Any engine may hold various child engines.
|
private ch.sahits.game.openpatrician.model.weapon.EWeapon |
getSmallWeaponType() |
void |
handleNewPirate(ch.sahits.game.openpatrician.model.event.NewPirateEvent pirateEvent)
Handle the even when a new pirate becomes available.
|
private boolean |
handlePirateShip(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel)
Check if the vessel should be handled by this engine.
|
void |
handleRepairFinished(RepairFinishedEvent event)
Handle the event for the finished repair.
|
void |
handleRepairPirateShip(ShipEntersPortEvent event) |
void |
handleShipPositionUpdate(ShipPositionUpdateEvent event)
Check if there is a ship near the new position and decide if an attack should be initiated.
|
void |
handleShipReachesDestination(ShipArrivesAtDestinationEvent event)
Ship has reached it's destination, select a new one.
|
void |
handleWeeklyUpdate(PeriodicalTimeWeekEndUpdate event)
Periodically check if there is a free pirate and if not, create one.
|
private void |
initialize() |
void |
initializedGraph(GraphInitialisationComplete event) |
private void |
selectDestination(ch.sahits.game.openpatrician.model.people.ISeaPirate pirate)
Select a new destination for the pirate.
|
private void |
sendForRepairs(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel)
Send a vessel to be repaired.
|
private final org.apache.logging.log4j.Logger logger
@Autowired private Random rnd
@Autowired private ch.sahits.game.openpatrician.model.people.impl.SeaPiratesState piratesState
@Autowired private LocationTracker locationTracker
@Autowired @Qualifier(value="serverClientEventBus") private com.google.common.eventbus.AsyncEventBus clientServerEventBus
@Autowired @Qualifier(value="timerEventBus") private com.google.common.eventbus.AsyncEventBus timerEventBus
@Autowired @Qualifier(value="syncServerClientEventBus") private com.google.common.eventbus.EventBus syncServerClientEventBus
@Autowired private ShipFactory shipFactory
@Autowired private IMapImageServiceFacade mapService
@Autowired private ch.sahits.game.openpatrician.model.map.IMap map
@Autowired private SeafaringService seafaringService
@Autowired private ShipyardEngine shipyardEngine
@Autowired private MapService cityService
@Autowired private ch.sahits.game.openpatrician.model.Date date
@Autowired private SeaFightService seaFightService
@Autowired private PeopleFactory peopleFactory
@Autowired private AStarHeuristicProvider aStarHeuristicProvider
@Autowired @Qualifier(value="schedulableServerThreadPool") private ScheduledExecutorService schedulableServerThreadPool
private boolean graphInitialized
private static ch.sahits.game.openpatrician.util.RandomNameLoader firstNameLoader
private static ch.sahits.game.openpatrician.util.RandomNameLoader lastNameLoader
private static ch.sahits.game.openpatrician.util.RandomNameLoader shipLoader
@PostConstruct private void initialize()
@PreDestroy private void destroy()
public List<AbstractEngine> getChildren()
AbstractEnginegetChildren in class AbstractEnginepublic void initializedGraph(GraphInitialisationComplete event)
public void handleNewPirate(ch.sahits.game.openpatrician.model.event.NewPirateEvent pirateEvent)
pirateEvent - public void handleShipReachesDestination(ShipArrivesAtDestinationEvent event)
event - private void selectDestination(ch.sahits.game.openpatrician.model.people.ISeaPirate pirate)
pirate - public void handleShipPositionUpdate(ShipPositionUpdateEvent event)
event - private void sendForRepairs(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel)
vessel - public void handleRepairPirateShip(ShipEntersPortEvent event)
public void handleRepairFinished(RepairFinishedEvent event)
event - public void handleWeeklyUpdate(PeriodicalTimeWeekEndUpdate event)
event - private ch.sahits.game.openpatrician.model.ship.IShip createInitialPiratesShip()
private boolean handlePirateShip(ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel)
vessel - private ch.sahits.game.openpatrician.model.weapon.EWeapon getBigWeaponType()
private ch.sahits.game.openpatrician.model.weapon.EWeapon getSmallWeaponType()
Copyright © 2011-2017 Sahits GmbH. All Rights Reserved.