Class BarrelConfiguration


  • public class BarrelConfiguration
    extends java.lang.Object
    Configuration for the barrel depending on the barrel size.
    Author:
    Andi Hotz, (c) Sahits GmbH, 2018 Created on Jul 28, 2018
    • Field Detail

      • iconSize

        private int iconSize
      • barrelTop

        private int barrelTop
      • barrelBottom

        private int barrelBottom
      • totalHeigh

        private int totalHeigh
    • Constructor Detail

      • BarrelConfiguration

        public BarrelConfiguration()
    • Method Detail

      • init

        @PostConstruct
        private void init()
      • getBarrelView

        public javafx.scene.image.ImageView getBarrelView()
        Get the image view in the correct size.
        Returns:
        ImageView for a barrel.
      • createBarrelShape

        public javafx.scene.shape.Path createBarrelShape()
        Create the path outlining the barrel.
        Returns:
        path shape of the barrel image view.
      • getUnloadableShape

        public javafx.scene.shape.Rectangle getUnloadableShape​(IShip ship)
        Calculate the rectangle covering the barrel shape that represents the amount of loadable space that cannot be loaded with cargo. This is the space occupied by weapons and passengers.
        Parameters:
        ship - for which to calculate.
        Returns:
        rectangular shape representing the unloadable space of the barrel
      • getCargoShape

        public javafx.scene.shape.Rectangle getCargoShape​(IShip ship)
        Calculate the rectangle covering the barrel shape that represents the amount of loaded wares.
        Parameters:
        ship - for which to calculate.
        Returns:
        rectangular shape representing the loaded ware.
      • getUnloadablePercentage

        private double getUnloadablePercentage​(IShip ship)
      • getUnloadableTop

        private double getUnloadableTop​(IShip ship)
      • getCargoPercentage

        private double getCargoPercentage​(IShip ship)
      • getCargoTop

        private double getCargoTop​(IShip ship)
      • getHeight

        private double getHeight​(double heighPercentage)