Class ContractBrokers

  • All Implemented Interfaces:
    ch.sahits.game.openpatrician.model.people.IContractBrokers

    @Component
    public class ContractBrokers
    extends java.lang.Object
    implements ch.sahits.game.openpatrician.model.people.IContractBrokers
    List of all contract brokers
    Author:
    Andi Hotz, (c) Sahits GmbH, 2018 Created on Apr 30, 2018
    • Constructor Summary

      Constructors 
      Constructor Description
      ContractBrokers()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(ch.sahits.game.openpatrician.model.people.IContractBroker broker, ch.sahits.game.openpatrician.model.city.ICity city)  
      void assignPlayer​(ch.sahits.game.openpatrician.model.IPlayer player, ch.sahits.game.openpatrician.model.people.IContractBroker broker, java.time.LocalDateTime deadline)
      Assign a player to a contract broker.
      java.util.Optional<ch.sahits.game.openpatrician.model.people.IContractBroker> findContractBroker​(ch.sahits.game.openpatrician.model.city.ICity city, ch.sahits.game.openpatrician.model.IPlayer player)  
      boolean hasContractBroker​(ch.sahits.game.openpatrician.model.city.ICity city)  
      void remove​(ch.sahits.game.openpatrician.model.people.IContractBroker broker)
      Remove the connections matching a specific broker.
      void removePastDeadline​(ch.sahits.game.event.data.PeriodicalDailyUpdate event)
      Daily checking if the deadline has passed.
      • Methods inherited from class java.lang.Object

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

      • ContractBrokers

        public ContractBrokers()
    • Method Detail

      • add

        public void add​(ch.sahits.game.openpatrician.model.people.IContractBroker broker,
                        ch.sahits.game.openpatrician.model.city.ICity city)
        Specified by:
        add in interface ch.sahits.game.openpatrician.model.people.IContractBrokers
      • assignPlayer

        public void assignPlayer​(ch.sahits.game.openpatrician.model.IPlayer player,
                                 ch.sahits.game.openpatrician.model.people.IContractBroker broker,
                                 java.time.LocalDateTime deadline)
        Assign a player to a contract broker.
        Parameters:
        player - to be assigned
        broker - to whom the player is assigned.
        deadline - until when the wares have to be delivered.
      • remove

        public void remove​(ch.sahits.game.openpatrician.model.people.IContractBroker broker)
        Remove the connections matching a specific broker.
        Parameters:
        broker - to be removed.
      • removePastDeadline

        public void removePastDeadline​(ch.sahits.game.event.data.PeriodicalDailyUpdate event)
        Daily checking if the deadline has passed.
        Parameters:
        event -
      • findContractBroker

        public java.util.Optional<ch.sahits.game.openpatrician.model.people.IContractBroker> findContractBroker​(ch.sahits.game.openpatrician.model.city.ICity city,
                                                                                                                ch.sahits.game.openpatrician.model.IPlayer player)
        Specified by:
        findContractBroker in interface ch.sahits.game.openpatrician.model.people.IContractBrokers
      • hasContractBroker

        public boolean hasContractBroker​(ch.sahits.game.openpatrician.model.city.ICity city)
        Specified by:
        hasContractBroker in interface ch.sahits.game.openpatrician.model.people.IContractBrokers