| Type | Property and Description |
|---|---|
javafx.beans.property.IntegerProperty |
numberOfSailors |
javafx.beans.binding.BooleanBinding |
passengerPresent
Binding indicating if a passenger is present.
|
| Modifier and Type | Field and Description |
|---|---|
private AmountableProvider |
amountableProvider |
private boolean |
available |
private Optional<ICaptain> |
captian |
private int |
distanceInKmForOneHealthPointReduction |
protected int |
fitness
Fitness of the ship.
|
private int |
initialValue
Initial value of the ship
|
private LateIntegerBinding |
loadBinding
Binding representing the current load.
|
private Map<IWare,AmountablePrice<IWare>> |
loadedWare
Store the wares loaded on the ship together with their amount.
|
private Map<IWeapon,Integer> |
loadedWeapons |
private javafx.geometry.Point2D |
location |
private org.apache.logging.log4j.Logger |
logger |
private LUIDProvider |
luidProvider |
private int |
maxSailors |
private int |
minNumberOfSailors |
protected String |
name
Name of the ship
|
private javafx.beans.property.IntegerProperty |
nbSailors |
private int |
occupiedSpace
Space occupied by wares not owned by the owner
|
private IShipOwner |
owner |
private Optional<IPerson> |
passenger |
private javafx.beans.binding.BooleanBinding |
passengerPresent |
private int |
passengerSpace |
private boolean |
pirateFlag |
private DependentPropertyInitializer |
propertyInitializer |
private int |
reductionLevel1 |
private int |
reductionLevel2 |
protected EShipUpgrade |
shipUpgradeLevel
State of the design standard level
|
private IShipWeaponsLocation |
shipWeaponsLocation |
private int |
size
Size in barrels
|
private double |
spacePerSailor
Amount of barrels space a sailor needs
|
private double |
topSpeed |
private String |
uuid |
| Modifier | Constructor and Description |
|---|---|
protected |
Ship(Properties shipConfiguration) |
| Modifier and Type | Method and Description |
|---|---|
void |
addPassenger(IPerson passanger)
Move a passenger to the ship.
|
protected void |
clearLoadedWares()
Clear all loaded wares.
|
private LateIntegerBinding |
createLoadBinding() |
void |
damage(int damage)
Damage the ship
|
private int |
ensureCapacity(int amount)
Check if the amount can be loaded
|
int |
getCapacity()
Available capacity of the ship, this represent the free storage in barrels
|
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
|
int |
getMaxNumberOfSailors()
Retrieve the maximum of sailors that can be put on the ship.
|
private EShipSide |
getNextFreeSide(IWeapon weapon)
Retrieve the side of the next free slot where the weapon can be placed.
|
private int |
getNextFreeSlot(IWeapon weapon,
EShipSide side)
Retrieve the next free slot for the weapon on the side.
|
int |
getNumberOfSailors()
Gets the value of the property numberOfSailors.
|
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.
|
double |
getTopSpeed()
Retrieve the speed of the vessel in kilometer per hour
|
int |
getUpgradeSpaceReduction()
Retrieve the reduction of the load capacity based on the upgrade level.
|
int |
getValue()
Retrieve the current value of the ship without its cargo
|
AmountablePrice<IWare> |
getWare(IWare ware)
Retrieve the amount of ware loaded
|
int |
getWeaponAmount(IWeapon weaponType)
Retrieve the amount of weapons on the ship
|
boolean |
hasWeapons()
check if weapons are on board
|
private void |
init() |
private int |
internalLoadCalculation() |
boolean |
isUpgradable()
Check if the ship can be upgraded
|
void |
leavePassanger()
Passenger leave ship.
|
int |
load(IWare ware,
int amount,
int avgPrice)
Load the ware in the specified amount onto the ship.
|
void |
move(IWeapon weaponType,
int amount)
Move weapons in or out.
|
javafx.beans.property.IntegerProperty |
numberOfSailorsProperty() |
javafx.beans.binding.BooleanBinding |
passengerPresentProperty()
Binding indicating if a passenger is present.
|
void |
setCaptain(ICaptain captain)
Set the captain on the ship
|
void |
setNumberOfSailors(int nbSailors)
Sets the value of the property numberOfSailors.
|
void |
setOwner(IShipOwner owner)
Define the owner 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.
|
void |
upgrade()
Upgrade the ship if it is upgradable
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDistanceInKmForOneHealthPointReduction, getMinNumberOfSailors, getOccupiedSpace, getPassenger, getShipType, getShipUpgradeLevel, getShipWeaponsLocation, isAvailable, repair, setAvailable, setName, setOccupiedSpace, setShipWeaponsLocationgetCaptian, getLocation, getName, getSize, getUuid, setLocationpublic javafx.beans.property.IntegerProperty numberOfSailorsProperty
numberOfSailorsProperty in interface IShipgetNumberOfSailors(),
setNumberOfSailors(int)public javafx.beans.binding.BooleanBinding passengerPresentProperty
passengerPresentProperty in interface IShipprivate final org.apache.logging.log4j.Logger logger
@DependentValue(value="sailor.space.on.ship") private double spacePerSailor
@DependentValue(value="passenger.space.on.ship") private int passengerSpace
private int distanceInKmForOneHealthPointReduction
@Autowired private LUIDProvider luidProvider
protected EShipUpgrade shipUpgradeLevel
protected String name
private Map<IWare,AmountablePrice<IWare>> loadedWare
private LateIntegerBinding loadBinding
private final double topSpeed
@Autowired private AmountableProvider amountableProvider
@Autowired private DependentPropertyInitializer propertyInitializer
private javafx.beans.binding.BooleanBinding passengerPresent
private IShipWeaponsLocation shipWeaponsLocation
private final int initialValue
private final int minNumberOfSailors
private final int maxSailors
protected int fitness
private javafx.beans.property.IntegerProperty nbSailors
private javafx.geometry.Point2D location
private IShipOwner owner
private boolean available
private int occupiedSpace
private final int size
private int reductionLevel1
private int reductionLevel2
private String uuid
private boolean pirateFlag
protected Ship(Properties shipConfiguration)
@PostConstruct private void init()
public int getMaxNumberOfSailors()
IShipgetMaxNumberOfSailors in interface IShippublic void setCaptain(ICaptain captain)
IShipsetCaptain in interface IShippublic boolean isUpgradable()
IShipisUpgradable in interface IShippublic void upgrade()
IShippublic Set<IWare> getLoadedWares()
INavigableVesselgetLoadedWares in interface INavigableVesselpublic int load(IWare ware, int amount, int avgPrice)
load in interface INavigableVesselware - to be loadedamount - of items the wareavgPrice - average price of one item of the wareprivate int ensureCapacity(int amount)
amount - public int unload(IWare ware, int amount)
unload in interface INavigableVesselware - to be unloadedamount - amount of items of ware to unloadprivate int internalLoadCalculation()
public javafx.beans.binding.IntegerBinding getLoadBinding()
INavigableVesselgetLoadBinding in interface INavigableVesselprotected void clearLoadedWares()
public AmountablePrice<IWare> getWare(IWare ware)
INavigableVesselgetWare in interface INavigableVesselprivate EShipSide getNextFreeSide(IWeapon weapon)
weapon - to be placedEShipSide.PORT, EShipSide.STARBOARD or nullprivate int getNextFreeSlot(IWeapon weapon, EShipSide side)
weapon - to be placedside - to be checked EShipSide.PORT or EShipSide.STARBOARDpublic boolean hasWeapons()
IShiphasWeapons in interface IShippublic int getValue()
IShippublic int getNumberOfSailors()
getNumberOfSailors in interface INavigableVesselpublic void setNumberOfSailors(int nbSailors)
setNumberOfSailors in interface IShipnbSailors - .public javafx.beans.property.IntegerProperty numberOfSailorsProperty()
numberOfSailorsProperty in interface IShipgetNumberOfSailors(),
setNumberOfSailors(int)public void move(IWeapon weaponType, int amount)
IShippublic int getWeaponAmount(IWeapon weaponType)
INavigableVesselgetWeaponAmount in interface INavigableVesselweaponType - SWORD | BOW | CROSSBOW | MUSKETpublic void addPassenger(IPerson passanger)
addPassenger in interface IShippassanger - public IShipOwner getOwner()
INavigableVesselgetOwner in interface INavigableVesselpublic void setOwner(IShipOwner owner)
IShippublic void leavePassanger()
leavePassanger in interface IShippublic int getCapacity()
INavigableVesselgetCapacity in interface INavigableVesselpublic int getUpgradeSpaceReduction()
IShipgetUpgradeSpaceReduction in interface IShipprivate LateIntegerBinding createLoadBinding()
public javafx.beans.binding.BooleanBinding passengerPresentProperty()
IShippassengerPresentProperty in interface IShippublic int getDamage()
INavigableVesselgetDamage in interface INavigableVesselpublic void damage(int damage)
INavigableVesseldamage in interface INavigableVesselpublic int getLoadableSpace()
INavigableVesselgetLoadableSpace in interface INavigableVesselpublic double getTopSpeed()
INavigableVesselgetTopSpeed in interface INavigableVesselpublic boolean getPirateFlag()
INavigableVesselgetPirateFlag in interface INavigableVesselpublic void togglePirateFlag()
INavigableVesseltogglePirateFlag in interface INavigableVesselpublic double getCurrentSpeed()
INavigableVesselgetCurrentSpeed in interface INavigableVesselCopyright © 2011-2017 Sahits GmbH. All Rights Reserved.