Class ClientTaskFactory
- java.lang.Object
-
- ch.sahits.game.openpatrician.clientserverinterface.service.ClientServerTaskFactory
-
- ch.sahits.game.openpatrician.display.event.task.ClientTaskFactory
-
@Service @Lazy @DependentInitialisation(StartNewGameBean.class) public class ClientTaskFactory extends ClientServerTaskFactory
Factory for the tasks in this player.- Author:
- Andi Hotz, (c) Sahits GmbH, 2014 Created on Feb 23, 2014
-
-
Field Summary
Fields Modifier and Type Field Description private org.springframework.context.ApplicationContext
context
-
Constructor Summary
Constructors Constructor Description ClientTaskFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IBreakInAction
getBreakInAction(IPlayer opponent)
Retrieve the task for breaking in into an opponents office.TimedTask
getBuyWares(ICityPlayerProxyJFX cityPlayerProxy, IBuyer buyer)
Retrieve the timed task for buying wares.TimedTask
getConcurrentReconciliation()
Retrieve the concurrent reconsiliation timer task.IDelayedCaughtAction
getDelayedCaughtAction(IPlayer player, ICity where)
Retrieve the delayed caught timed task.FinedTimedTask
getFinedTask(IHumanPlayer player, int fine, java.lang.String messageKey, java.time.LocalDateTime deadline)
Create a timed task for a fine.FreePirateTimedTask
getFreePirateTask(INonFreeSeaPirate seaPirate, java.time.LocalDateTime deadline)
Create a timed task to free a non free sea pirate.MarriageFeastDeliveryTask
getMarriageFeastDelivery(java.time.LocalDateTime deadline, IPlayer player, ICity city)
Create a timed task for the marriage feast delivery check.MarriageOfferTimedTask
getMarriageOfferTask(IHumanPlayer player, MarriageBrokerAnnouncementState state, java.time.LocalDateTime deadLine)
Create a timed task for the marriage offer.OpponentsOrder
getOpponentsOrder(IPlayer opponent, IPlayer client, IPlayer player, int premium)
Retrieve the oponents order.PostponedDisplayDialogMessage
getPostponedDisplayDialogMessage(java.time.LocalDateTime executionTime, EMessageCategory category, DialogTemplate template)
Retrieve the postponed display message task.PostponedDisplayMessage
getPostponedDisplayMessage(java.time.LocalDateTime executionTime, EMessageCategory category, java.lang.String messageKey, java.lang.Object... messageArgs)
Retrieve the postponed display message task.ChurchFeedingReputationUpdateTimedTask
getReputationUpdateTaskChurchFeeding(ICity city, IPlayer player, int amountBeggers, java.time.LocalDateTime deadline)
Create a timed task for the reputation update upon a church feeding.TravelToTimedTask
getTravelToDelayed(javafx.geometry.Point2D destination, INavigableVessel vessel, java.util.Optional<ICity> city)
Create a timed task for the delayed traveling event triggered and handled by the map view.WarehouseTentantLeaveTimedTask
getWarehouseTenantLeaving(ITradingOffice office, IWarehouseTenant tenant, java.time.LocalDateTime dealine)
Create a timed task for the leaving of the warehouse tenant.WarehouseTenantPayTimedTask
getWarehouseTenantPayment(IPlayer player, IWarehouseTenant tenant, java.time.LocalDateTime deadLine)
Create a timed task for the payment of the warehouse tenant.-
Methods inherited from class ch.sahits.game.openpatrician.clientserverinterface.service.ClientServerTaskFactory
getCelebrationEvent, getMarriageCelebrationEvent, getReschedulableSailorHireTask, getReschedulableWeaponBuyTask
-
-
-
-
Method Detail
-
getOpponentsOrder
public OpponentsOrder getOpponentsOrder(IPlayer opponent, IPlayer client, IPlayer player, int premium)
Retrieve the oponents order.- Parameters:
opponent
- playerclient
- who gives the orderplayer
- the order executorpremium
- on successful execution- Returns:
- Order of the opponent
-
getConcurrentReconciliation
public TimedTask getConcurrentReconciliation()
Retrieve the concurrent reconsiliation timer task.- Returns:
- reconciliation task
-
getBuyWares
public TimedTask getBuyWares(ICityPlayerProxyJFX cityPlayerProxy, IBuyer buyer)
Retrieve the timed task for buying wares.- Parameters:
cityPlayerProxy
- proxy instancebuyer
- client- Returns:
- task to buy wares
-
getDelayedCaughtAction
public IDelayedCaughtAction getDelayedCaughtAction(IPlayer player, ICity where)
Retrieve the delayed caught timed task.- Parameters:
player
- that is caughtwhere
- city where the player is caught- Returns:
- delayed action of being caught
-
getBreakInAction
public IBreakInAction getBreakInAction(IPlayer opponent)
Retrieve the task for breaking in into an opponents office.- Parameters:
opponent
- .- Returns:
- break in action
-
getPostponedDisplayMessage
public PostponedDisplayMessage getPostponedDisplayMessage(java.time.LocalDateTime executionTime, EMessageCategory category, java.lang.String messageKey, java.lang.Object... messageArgs)
Retrieve the postponed display message task. Add the task to the task list.- Parameters:
executionTime
- when the message should pop upcategory
- of the messagemessageKey
- text key of the messagemessageArgs
- array of message arguments- Returns:
- postponed display message
-
getPostponedDisplayDialogMessage
public PostponedDisplayDialogMessage getPostponedDisplayDialogMessage(java.time.LocalDateTime executionTime, EMessageCategory category, DialogTemplate template)
Retrieve the postponed display message task. The message is added to the task list.- Parameters:
executionTime
- when the message should pop upcategory
- of the messagetemplate
- dialog template used for the dialog- Returns:
- postponed display dialog message
-
getFinedTask
public FinedTimedTask getFinedTask(IHumanPlayer player, int fine, java.lang.String messageKey, java.time.LocalDateTime deadline)
Create a timed task for a fine.- Parameters:
player
- the fined playerfine
- positive fine amountmessageKey
- message key of the fine messagedeadline
- time of the event- Returns:
- timed event to be supplied to the timed task list.
-
getMarriageOfferTask
public MarriageOfferTimedTask getMarriageOfferTask(IHumanPlayer player, MarriageBrokerAnnouncementState state, java.time.LocalDateTime deadLine)
Create a timed task for the marriage offer.- Parameters:
player
- for whom the off isstate
- of the marriage announcemntdeadLine
- of the task execution- Returns:
- timed task to be suppled to the task list
-
getTravelToDelayed
public TravelToTimedTask getTravelToDelayed(javafx.geometry.Point2D destination, INavigableVessel vessel, java.util.Optional<ICity> city)
Create a timed task for the delayed traveling event triggered and handled by the map view.- Parameters:
destination
- coordinates on the screenvessel
- that travelscity
- if the destination is a city- Returns:
- timed task to be supplied to the timed task list.
-
getWarehouseTenantPayment
public WarehouseTenantPayTimedTask getWarehouseTenantPayment(IPlayer player, IWarehouseTenant tenant, java.time.LocalDateTime deadLine)
Create a timed task for the payment of the warehouse tenant.- Parameters:
player
- to which the payment is being made.tenant
- who does the paymentdeadLine
- when the payment happens- Returns:
- timed task to be supplied to the task list.
-
getWarehouseTenantLeaving
public WarehouseTentantLeaveTimedTask getWarehouseTenantLeaving(ITradingOffice office, IWarehouseTenant tenant, java.time.LocalDateTime dealine)
Create a timed task for the leaving of the warehouse tenant.- Parameters:
office
- which is occupied by the tenanttenant
- who is leavingdealine
- date of the leaving- Returns:
- timed task to be supplied to the task list.
-
getFreePirateTask
public FreePirateTimedTask getFreePirateTask(INonFreeSeaPirate seaPirate, java.time.LocalDateTime deadline)
Create a timed task to free a non free sea pirate.- Parameters:
seaPirate
- to be freed.deadline
- when it will happen- Returns:
- timed task to be supplied to the task list.
-
getReputationUpdateTaskChurchFeeding
public ChurchFeedingReputationUpdateTimedTask getReputationUpdateTaskChurchFeeding(ICity city, IPlayer player, int amountBeggers, java.time.LocalDateTime deadline)
Create a timed task for the reputation update upon a church feeding.- Parameters:
city
- where the feeding happendplayer
- who sponsored the feedingamountBeggers
- amount of feed beggarsdeadline
- when it will happen- Returns:
- timed task to be supplied to the task list.
-
getMarriageFeastDelivery
public MarriageFeastDeliveryTask getMarriageFeastDelivery(java.time.LocalDateTime deadline, IPlayer player, ICity city)
Create a timed task for the marriage feast delivery check.- Parameters:
deadline
- when the check should happen.player
- who is responsible for delivering the warescity
- where the wedding is happening.- Returns:
- timed task to be supplied to the task list.
-
-