Class ClientTaskFactory
- java.lang.Object
-
- ch.sahits.game.openpatrician.clientserverinterface.service.ClientServerTaskFactory
-
- ch.sahits.game.openpatrician.display.event.task.ClientTaskFactory
-
@Service @Lazy @DependentInitialisation(ch.sahits.game.openpatrician.model.initialisation.StartNewGameBean.class) public class ClientTaskFactory extends ch.sahits.game.openpatrician.clientserverinterface.service.ClientServerTaskFactoryFactory for the tasks in this player.- Author:
- Andi Hotz, (c) Sahits GmbH, 2014 Created on Feb 23, 2014
-
-
Constructor Summary
Constructors Constructor Description ClientTaskFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IBreakInActiongetBreakInAction(ch.sahits.game.openpatrician.model.IPlayer opponent)Retrieve the task for breaking in into an opponents office.ch.sahits.game.openpatrician.model.event.TimedTaskgetBuyWares(ch.sahits.game.openpatrician.clientserverinterface.client.ICityPlayerProxyJFX cityPlayerProxy, ch.sahits.game.openpatrician.model.people.IBuyer buyer)Retrieve the timed task for buying wares.ch.sahits.game.openpatrician.model.event.TimedTaskgetConcurrentReconciliation()Retrieve the concurrent reconsiliation timer task.IDelayedCaughtActiongetDelayedCaughtAction(ch.sahits.game.openpatrician.model.IPlayer player, ch.sahits.game.openpatrician.model.city.ICity where)Retrieve the delayed caught timed task.FinedTimedTaskgetFinedTask(ch.sahits.game.openpatrician.model.IHumanPlayer player, int fine, java.lang.String messageKey, java.time.LocalDateTime deadline)Create a timed task for a fine.FreePirateTimedTaskgetFreePirateTask(ch.sahits.game.openpatrician.model.people.INonFreeSeaPirate seaPirate, java.time.LocalDateTime deadline)Create a timed task to free a non free sea pirate.MarriageFeastDeliveryTaskgetMarriageFeastDelivery(java.time.LocalDateTime deadline, ch.sahits.game.openpatrician.model.IPlayer player, ch.sahits.game.openpatrician.model.city.ICity city)Create a timed task for the marriage feast delivery check.MarriageOfferTimedTaskgetMarriageOfferTask(ch.sahits.game.openpatrician.model.IHumanPlayer player, ch.sahits.game.openpatrician.clientserverinterface.model.event.MarriageBrokerAnnouncementState state, java.time.LocalDateTime deadLine)Create a timed task for the marriage offer.OpponentsOrdergetOpponentsOrder(ch.sahits.game.openpatrician.model.IPlayer opponent, ch.sahits.game.openpatrician.model.IPlayer client, ch.sahits.game.openpatrician.model.IPlayer player, int premium)Retrieve the oponents order.ch.sahits.game.openpatrician.clientserverinterface.event.PostponedDisplayDialogMessagegetPostponedDisplayDialogMessage(java.time.LocalDateTime executionTime, ch.sahits.game.openpatrician.model.EMessageCategory category, ch.sahits.game.openpatrician.model.ui.DialogTemplate template)Retrieve the postponed display message task.ch.sahits.game.openpatrician.clientserverinterface.event.PostponedDisplayMessagegetPostponedDisplayMessage(java.time.LocalDateTime executionTime, ch.sahits.game.openpatrician.model.EMessageCategory category, java.lang.String messageKey, java.lang.Object... messageArgs)Retrieve the postponed display message task.ChurchFeedingReputationUpdateTimedTaskgetReputationUpdateTaskChurchFeeding(ch.sahits.game.openpatrician.model.city.ICity city, ch.sahits.game.openpatrician.model.IPlayer player, int amountBeggers, java.time.LocalDateTime deadline)Create a timed task for the reputation update upon a church feeding.TravelToTimedTaskgetTravelToDelayed(javafx.geometry.Point2D destination, ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel, java.util.Optional<ch.sahits.game.openpatrician.model.city.ICity> city)Create a timed task for the delayed traveling event triggered and handled by the map view.WarehouseTentantLeaveTimedTaskgetWarehouseTenantLeaving(ch.sahits.game.openpatrician.model.building.ITradingOffice office, ch.sahits.game.openpatrician.model.people.IWarehouseTenant tenant, java.time.LocalDateTime dealine)Create a timed task for the leaving of the warehouse tenant.WarehouseTenantPayTimedTaskgetWarehouseTenantPayment(ch.sahits.game.openpatrician.model.IPlayer player, ch.sahits.game.openpatrician.model.people.IWarehouseTenant tenant, java.time.LocalDateTime deadLine)Create a timed task for the payment of the warehouse tenant.
-
-
-
Method Detail
-
getOpponentsOrder
public OpponentsOrder getOpponentsOrder(ch.sahits.game.openpatrician.model.IPlayer opponent, ch.sahits.game.openpatrician.model.IPlayer client, ch.sahits.game.openpatrician.model.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 ch.sahits.game.openpatrician.model.event.TimedTask getConcurrentReconciliation()
Retrieve the concurrent reconsiliation timer task.- Returns:
- reconciliation task
-
getBuyWares
public ch.sahits.game.openpatrician.model.event.TimedTask getBuyWares(ch.sahits.game.openpatrician.clientserverinterface.client.ICityPlayerProxyJFX cityPlayerProxy, ch.sahits.game.openpatrician.model.people.IBuyer buyer)Retrieve the timed task for buying wares.- Parameters:
cityPlayerProxy- proxy instancebuyer- client- Returns:
- task to buy wares
-
getDelayedCaughtAction
public IDelayedCaughtAction getDelayedCaughtAction(ch.sahits.game.openpatrician.model.IPlayer player, ch.sahits.game.openpatrician.model.city.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(ch.sahits.game.openpatrician.model.IPlayer opponent)
Retrieve the task for breaking in into an opponents office.- Parameters:
opponent- .- Returns:
- break in action
-
getPostponedDisplayMessage
public ch.sahits.game.openpatrician.clientserverinterface.event.PostponedDisplayMessage getPostponedDisplayMessage(java.time.LocalDateTime executionTime, ch.sahits.game.openpatrician.model.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 ch.sahits.game.openpatrician.clientserverinterface.event.PostponedDisplayDialogMessage getPostponedDisplayDialogMessage(java.time.LocalDateTime executionTime, ch.sahits.game.openpatrician.model.EMessageCategory category, ch.sahits.game.openpatrician.model.ui.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(ch.sahits.game.openpatrician.model.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(ch.sahits.game.openpatrician.model.IHumanPlayer player, ch.sahits.game.openpatrician.clientserverinterface.model.event.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, ch.sahits.game.openpatrician.model.ship.INavigableVessel vessel, java.util.Optional<ch.sahits.game.openpatrician.model.city.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(ch.sahits.game.openpatrician.model.IPlayer player, ch.sahits.game.openpatrician.model.people.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(ch.sahits.game.openpatrician.model.building.ITradingOffice office, ch.sahits.game.openpatrician.model.people.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(ch.sahits.game.openpatrician.model.people.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(ch.sahits.game.openpatrician.model.city.ICity city, ch.sahits.game.openpatrician.model.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, ch.sahits.game.openpatrician.model.IPlayer player, ch.sahits.game.openpatrician.model.city.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.
-
-