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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      javafx.scene.shape.Path createBarrelShape()
      Create the path outlining the barrel.
      javafx.scene.image.ImageView getBarrelView()
      Get the image view in the correct size.
      javafx.scene.shape.Rectangle getCargoShape​(ch.sahits.game.openpatrician.model.ship.IShip ship)
      Calculate the rectangle covering the barrel shape that represents the amount of loaded wares.
      javafx.scene.shape.Rectangle getUnloadableShape​(ch.sahits.game.openpatrician.model.ship.IShip ship)
      Calculate the rectangle covering the barrel shape that represents the amount of loadable space that cannot be loaded with cargo.
      • Methods inherited from class java.lang.Object

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

      • BarrelConfiguration

        public BarrelConfiguration()
    • Method Detail

      • 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​(ch.sahits.game.openpatrician.model.ship.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​(ch.sahits.game.openpatrician.model.ship.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.