Class BarrelConfiguration
- java.lang.Object
-
- ch.sahits.game.openpatrician.display.model.BarrelConfiguration
-
public class BarrelConfiguration extends java.lang.ObjectConfiguration for the barrel depending on the barrel size.- Author:
- Andi Hotz, (c) Sahits GmbH, 2018 Created on Jul 28, 2018
-
-
Constructor Summary
Constructors Constructor Description BarrelConfiguration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javafx.scene.shape.PathcreateBarrelShape()Create the path outlining the barrel.javafx.scene.image.ImageViewgetBarrelView()Get the image view in the correct size.javafx.scene.shape.RectanglegetCargoShape(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.RectanglegetUnloadableShape(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.
-
-
-
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.
-
-