Class WaitTimeForShipArrivalInCity


  • public abstract class WaitTimeForShipArrivalInCity
    extends ch.sahits.game.openpatrician.event.handler.ShipEntersPortEventListener
    Wait for until a defined time for the arrival of a ship in a city. If the time has passed this event listener unregisters itself from the queue.
    Author:
    Andi Hotz, (c) Sahits GmbH, 2013 Created on Feb 20, 2013
    • Field Summary

      • Fields inherited from class ch.sahits.game.openpatrician.event.handler.ShipEntersPortEventListener

        clientServerEventBus
    • Constructor Summary

      Constructors 
      Constructor Description
      WaitTimeForShipArrivalInCity​(ch.sahits.game.openpatrician.model.city.ICity city, ch.sahits.game.openpatrician.model.ship.INavigableVessel ship, java.time.LocalDateTime deadline)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void destroy()
      Action that is taken when the time has run out.
      void handleShipEntersPort​(ch.sahits.game.openpatrician.event.data.ShipEntersPortEvent event)
      Base implementation for the ship arival in a city before a deadline is passed.
      • Methods inherited from class ch.sahits.game.openpatrician.event.handler.ShipEntersPortEventListener

        execute, getCity, getShip, ignoreEventCity
      • Methods inherited from class java.lang.Object

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

      • WaitTimeForShipArrivalInCity

        public WaitTimeForShipArrivalInCity​(ch.sahits.game.openpatrician.model.city.ICity city,
                                            ch.sahits.game.openpatrician.model.ship.INavigableVessel ship,
                                            java.time.LocalDateTime deadline)
    • Method Detail

      • handleShipEntersPort

        public void handleShipEntersPort​(ch.sahits.game.openpatrician.event.data.ShipEntersPortEvent event)
        Base implementation for the ship arival in a city before a deadline is passed. If the event occurs after the deadline this instance is unregistered from the event bus and the destroy method called. Otherwise the super method is triggered.
        Overrides:
        handleShipEntersPort in class ch.sahits.game.openpatrician.event.handler.ShipEntersPortEventListener
        Parameters:
        event - of ship entering port
      • destroy

        public void destroy()
        Action that is taken when the time has run out.