Class ClientTaskFactory


  • @Service
    @Lazy
    @DependentInitialisation(ch.sahits.game.openpatrician.model.initialisation.StartNewGameBean.class)
    public class ClientTaskFactory
    extends ch.sahits.game.openpatrician.clientserverinterface.service.ClientServerTaskFactory
    Factory for the tasks in this player.
    Author:
    Andi Hotz, (c) Sahits GmbH, 2014 Created on Feb 23, 2014
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      IBreakInAction getBreakInAction​(ch.sahits.game.openpatrician.model.IPlayer opponent)
      Retrieve the task for breaking in into an opponents office.
      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.
      ch.sahits.game.openpatrician.model.event.TimedTask getConcurrentReconciliation()
      Retrieve the concurrent reconsiliation timer task.
      IDelayedCaughtAction getDelayedCaughtAction​(ch.sahits.game.openpatrician.model.IPlayer player, ch.sahits.game.openpatrician.model.city.ICity where)
      Retrieve the delayed caught timed task.
      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.
      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.
      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.
      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.
      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.
      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.
      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.
      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.
      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.
      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.
      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.
      • Methods inherited from class ch.sahits.game.openpatrician.clientserverinterface.service.ClientServerTaskFactory

        getCelebrationEvent, getMarriageCelebrationEvent, getReschedulableSailorHireTask, getReschedulableWeaponBuyTask
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ClientTaskFactory

        public ClientTaskFactory()
    • 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 - player
        client - who gives the order
        player - the order executor
        premium - 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 instance
        buyer - 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 caught
        where - 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 up
        category - of the message
        messageKey - text key of the message
        messageArgs - 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 up
        category - of the message
        template - 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 player
        fine - positive fine amount
        messageKey - message key of the fine message
        deadline - 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 is
        state - of the marriage announcemnt
        deadLine - 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 screen
        vessel - that travels
        city - 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 payment
        deadLine - 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 tenant
        tenant - who is leaving
        dealine - 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 happend
        player - who sponsored the feeding
        amountBeggers - amount of feed beggars
        deadline - 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 wares
        city - where the wedding is happening.
        Returns:
        timed task to be supplied to the task list.