Class ServerSideTaskFactory

    • Field Detail

      • context

        @Autowired
        private org.springframework.context.ApplicationContext context
    • Constructor Detail

      • ServerSideTaskFactory

        public ServerSideTaskFactory()
    • 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
      • 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 time
        vessel - vessel to be repaired
        owner - 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 time
        ship - 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 time
        ship - 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 addressed
        state - of the marraiage offer announcement
        deadLine - 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 upgreaded
        deadline - 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 contract
        deadline - 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 contract
        debitor - 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 buildt
        weapon - 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 updated
        delta - 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 based
        player - for which the dialog is to be posted
        messageKey - key of the dialog
        messageParams - 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 vessel
        waitingOnVessel - other vessel on which is waited for.
        waitingIn - destination city, where both vessels should arrive
        actionUponArrival - action that is executed, when both ships are present at the destination
        waitingShipArrived - flag indicating that the waiting vessel is already present at the destination.
        Returns:
        the task