Class WaitTimeForShipArrivalInCity
- java.lang.Object
-
- ch.sahits.game.openpatrician.event.handler.ShipEntersPortEventListener
-
- ch.sahits.game.openpatrician.display.event.handler.impl.WaitTimeForShipArrivalInCity
-
public abstract class WaitTimeForShipArrivalInCity extends ch.sahits.game.openpatrician.event.handler.ShipEntersPortEventListenerWait 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
-
-
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 voiddestroy()Action that is taken when the time has run out.voidhandleShipEntersPort(ch.sahits.game.openpatrician.event.data.ShipEntersPortEvent event)Base implementation for the ship arival in a city before a deadline is passed.
-
-
-
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:
handleShipEntersPortin classch.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.
-
-