Class ServerSideTaskFactory
- java.lang.Object
-
- ch.sahits.game.openpatrician.clientserverinterface.service.ClientServerTaskFactory
-
- ch.sahits.game.openpatrician.engine.event.task.ServerSideTaskFactory
-
@Service @Lazy @DependentInitialisation(StartNewGameBean.class) public class ServerSideTaskFactory extends ClientServerTaskFactory
- Author:
- Andi Hotz, (c) Sahits GmbH, 2014 Created on Mar 01, 2014
-
-
Field Summary
Fields Modifier and Type Field Description private org.springframework.context.ApplicationContext
context
-
Constructor Summary
Constructors Constructor Description ServerSideTaskFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TimedTask
getAIShipRefitTask(java.time.LocalDateTime dueDate, IShip ship, EShipUpgrade upgrade, IShipyard shipyard)
Retrieve the refit task for an AI ship.TimedTask
getAIShipRepairTask(java.time.LocalDateTime dueDate, IShip ship, IShipyard shipyard)
Retrieve the repair task for an AI ship.ChurchUpgradeTimedTask
getChurchUpgradeTask(IChurch church, java.time.LocalDateTime deadline)
Create the timed task for the church upgrade.ClearCityEventTask
getClearCityEventTask(java.time.LocalDateTime executionTime, ICity city)
Retrieve the timed task to clear the city event.TimedTask
getDailyAIPlayerCheck()
Retrieve the daily check for the AI playerLoanerCollectMoneyAfterAuctionTimedTask
getLoanerCollectMoneyAfterAuctionTask(IDebt debt, java.time.LocalDateTime deadline)
Create the timed task for the loaner to collect money from the debitor after an auction.LoanerCollectMoneyWithoutAuctionTimedTask
getLoanerCollectMoneyTask(IDebt debt, IPlayer debitor, java.time.LocalDateTime deadline)
Create a timed task for the loaner to collect money.MarriageOfferDeclinedTimedTask
getMarriageOfferDeclinedTask(IPlayer player)
Retrieve the timed task for the declined marriage offer.MarriageOfferTask
getMarriageOfferTask(IAIPlayer player, MarriageBrokerAnnouncementState state, java.time.LocalDateTime deadLine)
Retrieve a timed task for the marriage offer.TimedTask
getPeriodicalDailyUpdateTask()
Update task that issues a PeriodicalDailyUpdate event on the event bus.TimedTask
getPirateRepairTask(java.time.LocalDateTime dueDate, INavigableVessel vessel, ISeaPirate owner, IShipyard shipyard)
Retrieve the repair task for a pirate vesselPostStateDialogToHumanPlayerTask
getPostStateDialogMessageTask(java.time.LocalDateTime executionTime, EMessageCategory category, IDialogState state, IPlayer player, java.lang.String messageKey, java.lang.Object[] messageParams)
Retrieve the timed task to post a state based dialog message if the player is human.TimedTask
getRefitShipTask(java.time.LocalDateTime executionTime, IShip ship, EShipUpgrade upgrade, ICityPlayerProxyJFX proxy, IShipyard shipyard)
Retrieve the ship refit task.TimedTask
getRepairTask(java.time.LocalDateTime executionTime, IShip ship, ICityPlayerProxyJFX proxy, IShipyard shipyard)
Retrieve the ship repair task.IShipBuildTask
getShipBuildTask(java.time.LocalDateTime executionTime, EShipType type, IPlayer owner, javafx.geometry.Point2D location, IShipyard shipyard)
Retrieve the ship build task.UpdatePopulationTask
getUpdatePopulationTask(java.time.LocalDateTime executionTime, EPopulationClass populationClass, int delta, ICity city)
Retrieve the timed task to update the population of a certain class.WeaponConstructionTask
getWeaponConstructionFinishedTask(IArmory armory, EWeapon weapon)
Retrieve the timed task for finishing a weapon construction.TimedTask
getWeeklyCityCheck()
Retrieve a weekly city check task.TimedTask
getWeeklyLoanerCheck()
Retrieve a weekly loaner check task.WaitForShipArrival
waitForShipArrival(INavigableVessel waitingVessel, INavigableVessel waitingOnVessel, ICity waitingIn, java.lang.Runnable actionUponArrival, boolean waitingShipArrived)
Retrieve the task for a ship to wait until another ship and itself arrived at the same destination city.-
Methods inherited from class ch.sahits.game.openpatrician.clientserverinterface.service.ClientServerTaskFactory
getCelebrationEvent, getMarriageCelebrationEvent, getReschedulableSailorHireTask, getReschedulableWeaponBuyTask
-
-
-
-
Method Detail
-
getRepairTask
public TimedTask getRepairTask(java.time.LocalDateTime executionTime, IShip ship, ICityPlayerProxyJFX proxy, IShipyard shipyard)
Retrieve the ship repair task.- Returns:
- ship repair task
-
getShipBuildTask
public IShipBuildTask getShipBuildTask(java.time.LocalDateTime executionTime, EShipType type, IPlayer owner, javafx.geometry.Point2D location, IShipyard shipyard)
Retrieve the ship build task.- Returns:
- ship build task
-
getRefitShipTask
public TimedTask getRefitShipTask(java.time.LocalDateTime executionTime, IShip ship, EShipUpgrade upgrade, ICityPlayerProxyJFX proxy, IShipyard shipyard)
Retrieve the ship refit task.- Returns:
- ship refit task
-
getPirateRepairTask
public TimedTask getPirateRepairTask(java.time.LocalDateTime dueDate, INavigableVessel vessel, ISeaPirate owner, IShipyard shipyard)
Retrieve the repair task for a pirate vessel- Parameters:
dueDate
- execution timevessel
- vessel to be repairedowner
- pirate owner- Returns:
- special repair task
-
getAIShipRepairTask
public TimedTask getAIShipRepairTask(java.time.LocalDateTime dueDate, IShip ship, IShipyard shipyard)
Retrieve the repair task for an AI ship.- Parameters:
dueDate
- execution timeship
- to be repaired- Returns:
- repair task for AI ships
-
getAIShipRefitTask
public TimedTask getAIShipRefitTask(java.time.LocalDateTime dueDate, IShip ship, EShipUpgrade upgrade, IShipyard shipyard)
Retrieve the refit task for an AI ship.- Parameters:
dueDate
- execution timeship
- to be upgraded- Returns:
- upgrade task for AI ships
-
getWeeklyLoanerCheck
public TimedTask getWeeklyLoanerCheck()
Retrieve a weekly loaner check task.- Returns:
- weekly loaner check task
-
getDailyAIPlayerCheck
public TimedTask getDailyAIPlayerCheck()
Retrieve the daily check for the AI player- Returns:
- daily AI player update task
-
getPeriodicalDailyUpdateTask
public TimedTask getPeriodicalDailyUpdateTask()
Update task that issues a PeriodicalDailyUpdate event on the event bus.- Returns:
- Daily update task
-
getWeeklyCityCheck
public TimedTask getWeeklyCityCheck()
Retrieve a weekly city check task.- Returns:
- weekly city check task
-
getMarriageOfferTask
public MarriageOfferTask getMarriageOfferTask(IAIPlayer player, MarriageBrokerAnnouncementState state, java.time.LocalDateTime deadLine)
Retrieve a timed task for the marriage offer.- Parameters:
player
- that is addressedstate
- of the marraiage offer announcementdeadLine
- when the offer will happen.- Returns:
- timed task to be submitted to the timed task list.
-
getChurchUpgradeTask
public ChurchUpgradeTimedTask getChurchUpgradeTask(IChurch church, java.time.LocalDateTime deadline)
Create the timed task for the church upgrade.- Parameters:
church
- to be upgreadeddeadline
- when it will happen- Returns:
- timed task to be supplied to the timed task list.
-
getLoanerCollectMoneyAfterAuctionTask
public LoanerCollectMoneyAfterAuctionTimedTask getLoanerCollectMoneyAfterAuctionTask(IDebt debt, java.time.LocalDateTime deadline)
Create the timed task for the loaner to collect money from the debitor after an auction.- Parameters:
debt
- debt contractdeadline
- when this will happen.- Returns:
- timed task to be supplied to the timed task list.
-
getLoanerCollectMoneyTask
public LoanerCollectMoneyWithoutAuctionTimedTask getLoanerCollectMoneyTask(IDebt debt, IPlayer debitor, java.time.LocalDateTime deadline)
Create a timed task for the loaner to collect money.- Parameters:
debt
- debt contractdebitor
- from whom to collect the money.deadline
- when this will happen.- Returns:
- timed task to be supplied to the timed task list.
-
getMarriageOfferDeclinedTask
public MarriageOfferDeclinedTimedTask getMarriageOfferDeclinedTask(IPlayer player)
Retrieve the timed task for the declined marriage offer.- Parameters:
player
- who declined the offer.- Returns:
- timed task to be supplied to the timed task list.
-
getWeaponConstructionFinishedTask
public WeaponConstructionTask getWeaponConstructionFinishedTask(IArmory armory, EWeapon weapon)
Retrieve the timed task for finishing a weapon construction.- Parameters:
armory
- in which the weapon was buildtweapon
- type that was built.- Returns:
- timed task to be supplied to the timed task list.
-
getUpdatePopulationTask
public UpdatePopulationTask getUpdatePopulationTask(java.time.LocalDateTime executionTime, EPopulationClass populationClass, int delta, ICity city)
Retrieve the timed task to update the population of a certain class.- Parameters:
executionTime
- when the task is to be executed.populationClass
- population class to be updateddelta
- of the population change (can be negative)city
- in which the population should be updated.- Returns:
- timed task for the population update.
-
getClearCityEventTask
public ClearCityEventTask getClearCityEventTask(java.time.LocalDateTime executionTime, ICity city)
Retrieve the timed task to clear the city event.- Parameters:
executionTime
- when the task is to be executed.city
- for which the event is to be cleared.- Returns:
- timed task for the event clearing.
-
getPostStateDialogMessageTask
public PostStateDialogToHumanPlayerTask getPostStateDialogMessageTask(java.time.LocalDateTime executionTime, EMessageCategory category, IDialogState state, IPlayer player, java.lang.String messageKey, java.lang.Object[] messageParams)
Retrieve the timed task to post a state based dialog message if the player is human.- Parameters:
executionTime
- when the task is to be executed.category
- into which the message is posted.state
- on which the dialog is basedplayer
- for which the dialog is to be postedmessageKey
- key of the dialogmessageParams
- message parameters- Returns:
- timed task for the state based display of a dialog.
-
waitForShipArrival
public WaitForShipArrival waitForShipArrival(INavigableVessel waitingVessel, INavigableVessel waitingOnVessel, ICity waitingIn, java.lang.Runnable actionUponArrival, boolean waitingShipArrived)
Retrieve the task for a ship to wait until another ship and itself arrived at the same destination city.- Parameters:
waitingVessel
- vessel that is waiting on the other vesselwaitingOnVessel
- other vessel on which is waited for.waitingIn
- destination city, where both vessels should arriveactionUponArrival
- action that is executed, when both ships are present at the destinationwaitingShipArrived
- flag indicating that the waiting vessel is already present at the destination.- Returns:
- the task
-
-