Class ServerSideTaskFactory
- java.lang.Object
-
- ch.sahits.game.openpatrician.clientserverinterface.service.ClientServerTaskFactory
-
- ch.sahits.game.openpatrician.engine.event.task.ServerSideTaskFactory
-
@Service @Lazy @DependentInitialisation(ch.sahits.game.openpatrician.model.initialisation.StartNewGameBean.class) public class ServerSideTaskFactory extends ch.sahits.game.openpatrician.clientserverinterface.service.ClientServerTaskFactory- Author:
- Andi Hotz, (c) Sahits GmbH, 2014 Created on Mar 01, 2014
-
-
Constructor Summary
Constructors Constructor Description ServerSideTaskFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ch.sahits.game.openpatrician.model.event.TimedTaskgetAIShipRefitTask(java.time.LocalDateTime dueDate, ch.sahits.game.openpatrician.model.ship.IShip ship, ch.sahits.game.openpatrician.model.ship.EShipUpgrade upgrade, ch.sahits.game.openpatrician.model.city.IShipyard shipyard)Retrieve the refit task for an AI ship.ch.sahits.game.openpatrician.model.event.TimedTaskgetAIShipRepairTask(java.time.LocalDateTime dueDate, ch.sahits.game.openpatrician.model.ship.IShip ship, ch.sahits.game.openpatrician.model.city.IShipyard shipyard)Retrieve the repair task for an AI ship.ChurchUpgradeTimedTaskgetChurchUpgradeTask(ch.sahits.game.openpatrician.model.city.IChurch church, java.time.LocalDateTime deadline)Create the timed task for the church upgrade.ClearCityEventTaskgetClearCityEventTask(java.time.LocalDateTime executionTime, ch.sahits.game.openpatrician.model.city.ICity city)Retrieve the timed task to clear the city event.ch.sahits.game.openpatrician.model.event.TimedTaskgetDailyAIPlayerCheck()Retrieve the daily check for the AI playerLoanerCollectMoneyAfterAuctionTimedTaskgetLoanerCollectMoneyAfterAuctionTask(ch.sahits.game.openpatrician.model.city.impl.IDebt debt, java.time.LocalDateTime deadline)Create the timed task for the loaner to collect money from the debitor after an auction.LoanerCollectMoneyWithoutAuctionTimedTaskgetLoanerCollectMoneyTask(ch.sahits.game.openpatrician.model.city.impl.IDebt debt, ch.sahits.game.openpatrician.model.IPlayer debitor, java.time.LocalDateTime deadline)Create a timed task for the loaner to collect money.MarriageOfferDeclinedTimedTaskgetMarriageOfferDeclinedTask(ch.sahits.game.openpatrician.model.IPlayer player)Retrieve the timed task for the declined marriage offer.MarriageOfferTaskgetMarriageOfferTask(ch.sahits.game.openpatrician.model.IAIPlayer player, ch.sahits.game.openpatrician.clientserverinterface.model.event.MarriageBrokerAnnouncementState state, java.time.LocalDateTime deadLine)Retrieve a timed task for the marriage offer.ch.sahits.game.openpatrician.model.event.TimedTaskgetPeriodicalDailyUpdateTask()Update task that issues a PeriodicalDailyUpdate event on the event bus.ch.sahits.game.openpatrician.model.event.TimedTaskgetPirateRepairTask(java.time.LocalDateTime dueDate, ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel, ch.sahits.game.openpatrician.model.people.ISeaPirate owner, ch.sahits.game.openpatrician.model.city.IShipyard shipyard)Retrieve the repair task for a pirate vesselPostStateDialogToHumanPlayerTaskgetPostStateDialogMessageTask(java.time.LocalDateTime executionTime, ch.sahits.game.openpatrician.model.EMessageCategory category, ch.sahits.game.openpatrician.model.ui.IDialogState state, ch.sahits.game.openpatrician.model.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.ch.sahits.game.openpatrician.model.event.TimedTaskgetRefitShipTask(java.time.LocalDateTime executionTime, ch.sahits.game.openpatrician.model.ship.IShip ship, ch.sahits.game.openpatrician.model.ship.EShipUpgrade upgrade, ch.sahits.game.openpatrician.clientserverinterface.client.ICityPlayerProxyJFX proxy, ch.sahits.game.openpatrician.model.city.IShipyard shipyard)Retrieve the ship refit task.ch.sahits.game.openpatrician.model.event.TimedTaskgetRepairTask(java.time.LocalDateTime executionTime, ch.sahits.game.openpatrician.model.ship.IShip ship, ch.sahits.game.openpatrician.clientserverinterface.client.ICityPlayerProxyJFX proxy, ch.sahits.game.openpatrician.model.city.IShipyard shipyard)Retrieve the ship repair task.ch.sahits.game.openpatrician.model.city.impl.IShipBuildTaskgetShipBuildTask(java.time.LocalDateTime executionTime, ch.sahits.game.openpatrician.model.ship.EShipType type, ch.sahits.game.openpatrician.model.IPlayer owner, javafx.geometry.Point2D location, ch.sahits.game.openpatrician.model.city.IShipyard shipyard)Retrieve the ship build task.UpdatePopulationTaskgetUpdatePopulationTask(java.time.LocalDateTime executionTime, ch.sahits.game.openpatrician.model.city.EPopulationClass populationClass, int delta, ch.sahits.game.openpatrician.model.city.ICity city)Retrieve the timed task to update the population of a certain class.WeaponConstructionTaskgetWeaponConstructionFinishedTask(ch.sahits.game.openpatrician.model.weapon.IArmory armory, ch.sahits.game.openpatrician.model.weapon.EWeapon weapon)Retrieve the timed task for finishing a weapon construction.ch.sahits.game.openpatrician.model.event.TimedTaskgetWeeklyCityCheck()Retrieve a weekly city check task.ch.sahits.game.openpatrician.model.event.TimedTaskgetWeeklyLoanerCheck()Retrieve a weekly loaner check task.WaitForShipArrivalwaitForShipArrival(ch.sahits.game.openpatrician.model.ship.INavigableVessel waitingVessel, ch.sahits.game.openpatrician.model.ship.INavigableVessel waitingOnVessel, ch.sahits.game.openpatrician.model.city.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.
-
-
-
Method Detail
-
getRepairTask
public ch.sahits.game.openpatrician.model.event.TimedTask getRepairTask(java.time.LocalDateTime executionTime, ch.sahits.game.openpatrician.model.ship.IShip ship, ch.sahits.game.openpatrician.clientserverinterface.client.ICityPlayerProxyJFX proxy, ch.sahits.game.openpatrician.model.city.IShipyard shipyard)Retrieve the ship repair task.- Returns:
- ship repair task
-
getShipBuildTask
public ch.sahits.game.openpatrician.model.city.impl.IShipBuildTask getShipBuildTask(java.time.LocalDateTime executionTime, ch.sahits.game.openpatrician.model.ship.EShipType type, ch.sahits.game.openpatrician.model.IPlayer owner, javafx.geometry.Point2D location, ch.sahits.game.openpatrician.model.city.IShipyard shipyard)Retrieve the ship build task.- Returns:
- ship build task
-
getRefitShipTask
public ch.sahits.game.openpatrician.model.event.TimedTask getRefitShipTask(java.time.LocalDateTime executionTime, ch.sahits.game.openpatrician.model.ship.IShip ship, ch.sahits.game.openpatrician.model.ship.EShipUpgrade upgrade, ch.sahits.game.openpatrician.clientserverinterface.client.ICityPlayerProxyJFX proxy, ch.sahits.game.openpatrician.model.city.IShipyard shipyard)Retrieve the ship refit task.- Returns:
- ship refit task
-
getPirateRepairTask
public ch.sahits.game.openpatrician.model.event.TimedTask getPirateRepairTask(java.time.LocalDateTime dueDate, ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel, ch.sahits.game.openpatrician.model.people.ISeaPirate owner, ch.sahits.game.openpatrician.model.city.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 ch.sahits.game.openpatrician.model.event.TimedTask getAIShipRepairTask(java.time.LocalDateTime dueDate, ch.sahits.game.openpatrician.model.ship.IShip ship, ch.sahits.game.openpatrician.model.city.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 ch.sahits.game.openpatrician.model.event.TimedTask getAIShipRefitTask(java.time.LocalDateTime dueDate, ch.sahits.game.openpatrician.model.ship.IShip ship, ch.sahits.game.openpatrician.model.ship.EShipUpgrade upgrade, ch.sahits.game.openpatrician.model.city.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 ch.sahits.game.openpatrician.model.event.TimedTask getWeeklyLoanerCheck()
Retrieve a weekly loaner check task.- Returns:
- weekly loaner check task
-
getDailyAIPlayerCheck
public ch.sahits.game.openpatrician.model.event.TimedTask getDailyAIPlayerCheck()
Retrieve the daily check for the AI player- Returns:
- daily AI player update task
-
getPeriodicalDailyUpdateTask
public ch.sahits.game.openpatrician.model.event.TimedTask getPeriodicalDailyUpdateTask()
Update task that issues a PeriodicalDailyUpdate event on the event bus.- Returns:
- Daily update task
-
getWeeklyCityCheck
public ch.sahits.game.openpatrician.model.event.TimedTask getWeeklyCityCheck()
Retrieve a weekly city check task.- Returns:
- weekly city check task
-
getMarriageOfferTask
public MarriageOfferTask getMarriageOfferTask(ch.sahits.game.openpatrician.model.IAIPlayer player, ch.sahits.game.openpatrician.clientserverinterface.model.event.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(ch.sahits.game.openpatrician.model.city.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(ch.sahits.game.openpatrician.model.city.impl.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(ch.sahits.game.openpatrician.model.city.impl.IDebt debt, ch.sahits.game.openpatrician.model.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(ch.sahits.game.openpatrician.model.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(ch.sahits.game.openpatrician.model.weapon.IArmory armory, ch.sahits.game.openpatrician.model.weapon.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, ch.sahits.game.openpatrician.model.city.EPopulationClass populationClass, int delta, ch.sahits.game.openpatrician.model.city.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, ch.sahits.game.openpatrician.model.city.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, ch.sahits.game.openpatrician.model.EMessageCategory category, ch.sahits.game.openpatrician.model.ui.IDialogState state, ch.sahits.game.openpatrician.model.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(ch.sahits.game.openpatrician.model.ship.INavigableVessel waitingVessel, ch.sahits.game.openpatrician.model.ship.INavigableVessel waitingOnVessel, ch.sahits.game.openpatrician.model.city.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
-
-