Class ShipyardEngine


  • @Service
    @Lazy
    @DependentInitialisation(ch.sahits.game.openpatrician.model.initialisation.StartNewGameBean.class)
    public class ShipyardEngine
    extends AbstractEngine
    The shipyard engine handled the activities on a shipyard. This engine is stateless, so it requires the IShipyard to work on.
    Author:
    Andi Hotz, (c) Sahits GmbH, 2014 Created on Mar 01, 2014
    • Constructor Summary

      Constructors 
      Constructor Description
      ShipyardEngine()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<AbstractEngine> getChildren()
      Any engine may hold various child engines.
      void handleOrderBuildEvent​(ch.sahits.game.openpatrician.event.data.ShipyardOrderBuild event)
      Recieve the event from the event bus and delegate it.
      void handleORderRefit​(ch.sahits.game.openpatrician.event.data.ShipyardOrderRefit event)
      Recieve the event from the event bus and delegate it.
      void handleOrderRepair​(ch.sahits.game.openpatrician.event.data.ShipyardOrderRepair event)
      Recieve the event from the event bus and delegate it.
      void refitAIShip​(ch.sahits.game.openpatrician.model.city.IShipyard shipyard, ch.sahits.game.openpatrician.model.ship.IShip ship)  
      void repair​(ch.sahits.game.openpatrician.model.city.IShipyard shipyard, ch.sahits.game.openpatrician.model.ship.IShipGroup shipGroup)
      Order the repair of a group of pirate ship.
      void repairAIShip​(ch.sahits.game.openpatrician.model.city.IShipyard shipyard, ch.sahits.game.openpatrician.model.ship.IShip ship)
      Order the repair of a single AI owned ship.
      void repairPirateShip​(ch.sahits.game.openpatrician.model.city.IShipyard shipyard, ch.sahits.game.openpatrician.model.ship.IShip ship)
      Order the repair of a single pirate ship.
      • Methods inherited from class java.lang.Object

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

      • ShipyardEngine

        public ShipyardEngine()
    • Method Detail

      • repair

        public void repair​(ch.sahits.game.openpatrician.model.city.IShipyard shipyard,
                           ch.sahits.game.openpatrician.model.ship.IShipGroup shipGroup)
        Order the repair of a group of pirate ship.
        Parameters:
        shipyard - where it should be repaired
        shipGroup - ships that should be repaired
      • repairPirateShip

        public void repairPirateShip​(ch.sahits.game.openpatrician.model.city.IShipyard shipyard,
                                     ch.sahits.game.openpatrician.model.ship.IShip ship)
        Order the repair of a single pirate ship.
        Parameters:
        shipyard - where it should be repaired
        ship - that should be repaired
      • repairAIShip

        public void repairAIShip​(ch.sahits.game.openpatrician.model.city.IShipyard shipyard,
                                 ch.sahits.game.openpatrician.model.ship.IShip ship)
        Order the repair of a single AI owned ship.
        Parameters:
        shipyard - where it should be repaired
        ship - that should be repaired
      • refitAIShip

        public void refitAIShip​(ch.sahits.game.openpatrician.model.city.IShipyard shipyard,
                                ch.sahits.game.openpatrician.model.ship.IShip ship)
      • getChildren

        public java.util.List<AbstractEngine> getChildren()
        Description copied from class: AbstractEngine
        Any engine may hold various child engines. This is the way to retrieve them. If there are no child engines, return an empty list. Subclasses have to implement this in the proper way.
        Specified by:
        getChildren in class AbstractEngine
        Returns:
        list of child engines.
      • handleOrderBuildEvent

        public void handleOrderBuildEvent​(ch.sahits.game.openpatrician.event.data.ShipyardOrderBuild event)
        Recieve the event from the event bus and delegate it.
        Parameters:
        event - shipyard order build
      • handleOrderRepair

        public void handleOrderRepair​(ch.sahits.game.openpatrician.event.data.ShipyardOrderRepair event)
        Recieve the event from the event bus and delegate it.
        Parameters:
        event - shipyard order repair
      • handleORderRefit

        public void handleORderRefit​(ch.sahits.game.openpatrician.event.data.ShipyardOrderRefit event)
        Recieve the event from the event bus and delegate it.
        Parameters:
        event - shipyard order refit