Interface INavigableVessel
-
- All Known Subinterfaces:
ICog
,IConvoy
,ICrayer
,IGroupableVessel
,IHolk
,IShip
,IShipGroup
,ISnaikka
public interface INavigableVessel
Na navigable vessel is either a ship or a group of ships that sail together.- Author:
- Andi Hotz, (c) Sahits GmbH, 2015 Created on Dec 24, 2015
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
damage(int damage, boolean destroyWeapon)
Damage the shipjava.util.Optional<IShipAutoTrading>
getAutotrading()
Get the auto trading for the ship.int
getCapacity()
Available capacity of the ship, this represent the free storage in barrelsjava.util.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)java.util.Set<IWare>
getLoadedWares()
Retrieve a list of all loaded waresjavafx.geometry.Point2D
getLocation()
Retrieve the location of the ship.int
getMinNumberOfSailors()
Retrieve the minimum of sailors needed to operate the ship.java.lang.String
getName()
Retrieve the name of the of the shipint
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.int
getSize()
Total capacity of the ship in barrels.double
getTopSpeed()
Retrieve the speed of the vessel in kilometer per hourjava.lang.String
getUuid()
Retrieve a universal unique identifier for the vessel.AmountablePrice<IWare>
getWare(IWare ware)
Retrieve the amount of ware loadedint
getWeaponAmount(IWeapon weaponType)
Retrieve the amount of weapons on the shipint
load(IWare ware, int amount, int avgPrice)
Load the ware in the specified amount onto the ship.javafx.beans.property.BooleanProperty
pirateFlagProperty()
Property defining the pirate activit y of the vessel.void
setAutoTrading(IShipAutoTrading autoTrading)
Set the ship auto trading.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.
-
-
-
Method Detail
-
getSize
int getSize()
Total capacity of the ship in barrels.- Returns:
- total holding capacity of the vessel in barrels
-
getCapacity
int getCapacity()
Available capacity of the ship, this represent the free storage in barrels- Returns:
- free capacity of the vessel in barrels
-
getName
java.lang.String getName()
Retrieve the name of the of the ship- Returns:
- name of the vessel.
-
getLoadedWares
java.util.Set<IWare> getLoadedWares()
Retrieve a list of all loaded wares- Returns:
- set of loaded wares.
-
load
int load(IWare ware, int amount, int avgPrice)
Load the ware in the specified amount onto the ship. The amount uses the size specified by the ware- Parameters:
ware
- to be loadedamount
- of items the wareavgPrice
- average price of one item of the ware- Returns:
- amount actually loaded
-
unload
int unload(IWare ware, int amount)
Unload the specified quantity of the ware. The amount uses the size specified by the ware- Parameters:
ware
- to be unloadedamount
- amount of items of ware to unload- Returns:
- amount of the ware unloaded
-
getDamage
int getDamage()
Retrieve the damage of the ship in percentage [0,100]- Returns:
- damage of the vessel.
-
damage
void damage(int damage, boolean destroyWeapon)
Damage the ship- Parameters:
damage
- amount of damage that is inflicteddestroyWeapon
- flag indicating if weapons may be destroyed.
-
getLoadBinding
javafx.beans.binding.IntegerBinding getLoadBinding()
Retrieve the amount of load in barrels that is loaded in actual wares (no wappen or crew)- Returns:
- amount of loaded wares in barrels
-
getWare
AmountablePrice<IWare> getWare(IWare ware)
Retrieve the amount of ware loaded- Parameters:
ware
- for which to retrieve price and amount- Returns:
- price and amount loaded on the vessel.
-
getNumberOfSailors
int getNumberOfSailors()
Retrieve the number of sailors on the ship.- Returns:
- number of sailors on the vessel
-
getMinNumberOfSailors
int getMinNumberOfSailors()
Retrieve the minimum of sailors needed to operate the ship.- Returns:
- minimum required amount of sailors.
-
getCaptian
java.util.Optional<ICaptain> getCaptian()
Retrieve the captain of the ship. There might not be a captain present.- Returns:
- Optional captain on the vessel. Empty if none is present.
-
getLocation
javafx.geometry.Point2D getLocation()
Retrieve the location of the ship.- Returns:
- current location of the vessel.
-
setLocation
void setLocation(javafx.geometry.Point2D location)
Set the location of the ship.- Parameters:
location
- of the ship
-
getOwner
IShipOwner getOwner()
Retrieve the owner of the ship. The owner cannot be retrieved if the pirate flag is set.- Returns:
- owner of the vessel.
-
getWeaponAmount
int getWeaponAmount(IWeapon weaponType)
Retrieve the amount of weapons on the ship- Parameters:
weaponType
- any ship weapon or big weapon.- Returns:
- amount available on the ship
-
getLoadableSpace
int getLoadableSpace()
Retrieve the total amount of space that is available to store stuff. This is the total amount of space minus any space due to upgrades.- Returns:
- avalable space in barrels
-
getTopSpeed
double getTopSpeed()
Retrieve the speed of the vessel in kilometer per hour- Returns:
- speed of the vessel in kilometer per hour.
-
getCurrentSpeed
double getCurrentSpeed()
Current top speed of the ship.- Returns:
- speed of the vessel in kilometer per hour.
-
getUuid
java.lang.String getUuid()
Retrieve a universal unique identifier for the vessel.- Returns:
- UUID as string.
-
getPirateFlag
boolean getPirateFlag()
Indicate if the vessel has hissed the pirate flag (Jolly Roger) and the vessel therefore should be considered a pirate vessel.- Returns:
- true if the Jolly Roger is hissed.
-
pirateFlagProperty
javafx.beans.property.BooleanProperty pirateFlagProperty()
Property defining the pirate activit y of the vessel.- Returns:
- bolean property for the pirate flag.
-
togglePirateFlag
void togglePirateFlag()
Hiss or lower the pirate flag (Jolly Roger).
-
getAutotrading
java.util.Optional<IShipAutoTrading> getAutotrading()
Get the auto trading for the ship. If nothing is defined, empty.- Returns:
- Optional of
IShipAutoTrading
.
-
setAutoTrading
void setAutoTrading(IShipAutoTrading autoTrading)
Set the ship auto trading.- Parameters:
autoTrading
- definition of the autorading, may be null to remove auto trading.
-
-