public class ShipGroup extends Object implements IShipGroup
| Modifier and Type | Field and Description |
|---|---|
private AmountableProvider |
amountableProvider |
private LateIntegerBinding |
loadBinding
Binding representing the current load.
|
private boolean |
pirateFlag |
private Random |
rnd |
private List<IShip> |
ships |
| Modifier and Type | Method and Description |
|---|---|
void |
addShip(IShip ship)
Add a ship to the convoy.
|
private LateIntegerBinding |
createLoadBinding() |
void |
damage(int damage)
Damage the ship
|
int |
getCapacity()
Available capacity of the ship, this represent the free storage in barrels
|
Optional<ICaptain> |
getCaptian()
Retrieve the captain of the ship.
|
double |
getCurrentSpeed()
Current top speed of the ship.
|
int |
getDamage()
Retrieve the damage of the ship in percentage [0,100]
|
int |
getLoadableSpace()
Retrieve the total amount of space that is available to store stuff.
|
javafx.beans.binding.IntegerBinding |
getLoadBinding()
Retrieve the amount of load in barrels that is loaded in actual wares (no wappen or crew)
|
Set<IWare> |
getLoadedWares()
Retrieve a list of all loaded wares
|
javafx.geometry.Point2D |
getLocation()
Retrieve the location of the ship.
|
String |
getName()
Retrieve the name of the of the ship
|
int |
getNumberOfSailors()
Retrieve the number of sailors on the ship.
|
IShipOwner |
getOwner()
Retrieve the owner of the ship.
|
boolean |
getPirateFlag()
Indicate if the vessel has hissed the pirate flag (Jolly Roger)
and the vessel therefore should be considered a pirate vessel.
|
List<IShip> |
getShips()
Retrieve a list of the ships in the convoy.
|
int |
getSize()
Total capacity of the ship in barrels
|
double |
getTopSpeed()
Retrieve the speed of the vessel in kilometer per hour
|
String |
getUuid()
Retrieve a universal unique identifier for the vessel.
|
AmountablePrice<IWare> |
getWare(IWare ware)
Retrieve the amount of ware loaded
|
int |
getWeaponAmount(IWeapon weaponType)
Retrieve the amount of weapons on the ship
|
int |
load(IWare ware,
int amount,
int avgPrice)
Load the ware in the specified amount onto the ship.
|
private LateIntegerBinding |
loadbinding() |
void |
removeShip(IShip ship)
Remove a ship from the convoy.
|
void |
setLocation(javafx.geometry.Point2D location)
Set the location of the ship.
|
void |
togglePirateFlag()
Hiss or lower the pirate flag (Jolly Roger).
|
int |
unload(IWare ware,
int amount)
Unload the specified quantity of the ware.
|
@Autowired private Random rnd
private boolean pirateFlag
@Autowired private AmountableProvider amountableProvider
private LateIntegerBinding loadBinding
public ShipGroup(IShip leadShip)
public int getSize()
INavigableVesselgetSize in interface INavigableVesselpublic int getCapacity()
INavigableVesselgetCapacity in interface INavigableVesselpublic String getName()
INavigableVesselgetName in interface INavigableVesselpublic Set<IWare> getLoadedWares()
INavigableVesselgetLoadedWares in interface INavigableVesselpublic int load(IWare ware, int amount, int avgPrice)
INavigableVesselload in interface INavigableVesselware - to be loadedamount - of items the wareavgPrice - average price of one item of the warepublic int unload(IWare ware, int amount)
INavigableVesselunload in interface INavigableVesselware - to be unloadedamount - amount of items of ware to unloadpublic int getDamage()
INavigableVesselgetDamage in interface INavigableVesselpublic void damage(int damage)
INavigableVesseldamage in interface INavigableVesselprivate LateIntegerBinding loadbinding()
private LateIntegerBinding createLoadBinding()
public javafx.beans.binding.IntegerBinding getLoadBinding()
INavigableVesselgetLoadBinding in interface INavigableVesselpublic AmountablePrice<IWare> getWare(IWare ware)
INavigableVesselgetWare in interface INavigableVesselpublic int getNumberOfSailors()
INavigableVesselgetNumberOfSailors in interface INavigableVesselpublic Optional<ICaptain> getCaptian()
INavigableVesselgetCaptian in interface INavigableVesselpublic javafx.geometry.Point2D getLocation()
INavigableVesselgetLocation in interface INavigableVesselpublic void setLocation(javafx.geometry.Point2D location)
INavigableVesselsetLocation in interface INavigableVessellocation - of the shippublic IShipOwner getOwner()
INavigableVesselgetOwner in interface INavigableVesselpublic int getWeaponAmount(IWeapon weaponType)
INavigableVesselgetWeaponAmount in interface INavigableVesselweaponType - SWORD | BOW | CROSSBOW | MUSKETpublic int getLoadableSpace()
INavigableVesselgetLoadableSpace in interface INavigableVesselpublic double getTopSpeed()
INavigableVesselgetTopSpeed in interface INavigableVesselpublic double getCurrentSpeed()
INavigableVesselgetCurrentSpeed in interface INavigableVesselpublic String getUuid()
INavigableVesselgetUuid in interface INavigableVesselpublic boolean getPirateFlag()
INavigableVesselgetPirateFlag in interface INavigableVesselpublic void togglePirateFlag()
INavigableVesseltogglePirateFlag in interface INavigableVesselpublic List<IShip> getShips()
IShipGroupgetShips in interface IGroupableVesselgetShips in interface IShipGrouppublic void addShip(IShip ship)
IShipGroupaddShip in interface IShipGroupship - to be added.public void removeShip(IShip ship)
IShipGroupremoveShip in interface IShipGroupship - to be removed.Copyright © 2011-2017 Sahits GmbH. All Rights Reserved.