Class ShipBuildTask

  • All Implemented Interfaces:
    IShipBuildTask, java.lang.Runnable

    class ShipBuildTask
    extends TimedTask
    implements IShipBuildTask
    Author:
    Andi Hotz, (c) Sahits GmbH, 2014 Created on Feb 23, 2014
    • Field Detail

      • owner

        private final IPlayer owner
      • shipUtility

        @Autowired
        private ShipFactory shipUtility
      • x

        private final double x
      • location

        private final javafx.geometry.Point2D location
      • ship

        private IShip ship
      • clientServerEventBus

        @Autowired
        @Qualifier("serverClientEventBus")
        private com.google.common.eventbus.AsyncEventBus clientServerEventBus
    • Constructor Detail

      • ShipBuildTask

        public ShipBuildTask​(java.time.LocalDateTime executionTime,
                             EShipType type,
                             IPlayer owner,
                             javafx.geometry.Point2D location,
                             IShipyard shipyard)
    • Method Detail

      • initializeShip

        @PostConstruct
        void initializeShip()
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
      • getShipToBeBuilt

        public IShip getShipToBeBuilt()
        Retrieve the ship that is to be built.
        Specified by:
        getShipToBeBuilt in interface IShipBuildTask
        Returns:
        ship that is beeing build
      • createShip

        private IShip createShip()
        Create the ship based on the ships type.
        Returns:
        ship that is beeing built
      • calculateShipCapacity

        private int calculateShipCapacity()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object