| Type | Property and Description |
|---|---|
javafx.beans.property.IntegerProperty |
numberOfSailors |
javafx.beans.property.ObjectProperty<IShip> |
parentShip
Property holding the parent ship in case of a grouping (convoy or group).
|
javafx.beans.binding.BooleanBinding |
passengerPresent
Binding indicating if a passenger is present.
|
javafx.beans.property.BooleanProperty |
pirateFlag
Property defining the pirate activit y of the vessel.
|
| Modifier and Type | Field and Description |
|---|---|
private AmountableProvider |
amountableProvider |
private boolean |
available |
private Optional<ICaptain> |
captian |
private int |
distanceInKmForOneHealthPointReduction |
private int |
fitness
Fitness of the ship.
|
private int |
initialValue
Initial value of the ship
|
private LateIntegerBinding |
loadBinding
Binding representing the current load.
|
private int |
loadedHandWeapons |
private Map<IWare,AmountablePrice<IWare>> |
loadedWare
Store the wares loaded on the ship together with their amount.
|
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 javafx.beans.property.ObjectProperty<IShip> |
parentShip |
private Optional<IPerson> |
passenger |
private javafx.beans.binding.BooleanBinding |
passengerPresent |
private int |
passengerSpace |
private javafx.beans.property.BooleanProperty |
pirateFlag |
private DependentPropertyInitializer |
propertyInitializer |
private int |
reductionLevel1 |
private int |
reductionLevel2 |
private Random |
rnd |
protected EShipUpgrade |
shipUpgradeLevel
State of the design standard level
|
private int |
size
Size in barrels
|
private double |
spacePerSailor
Amount of barrels space a sailor needs
|
private double |
topSpeed |
private String |
uuid |
private List<IWeaponSlot> |
weaponSlots |
| Constructor and Description |
|---|
Ship() |
| 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,
boolean destroyWeapon)
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.
|
int |
getNumberOfSailors()
Gets the value of the property numberOfSailors.
|
int |
getOccupiedSpaceByWeapons()
Retrieve the amount of space used for the weapons.
|
IShipOwner |
getOwner()
Retrieve the owner of the ship.
|
boolean |
getPirateFlag()
Gets the value of the property pirateFlag.
|
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
|
private boolean |
hasWeapons() |
private void |
init() |
protected void |
initializeProperties(ShipProperties.Ship shipConfiguration) |
private int |
internalLoadCalculation()
Calculate the amount that is loaded on the ship in barrels.
|
private boolean |
isLargeWeapon(EWeapon weapon) |
boolean |
isUpgradable()
Check if the ship can be upgraded
|
void |
leavePassenger()
Passenger leave ship.
|
int |
load(IWare ware,
int amount,
int avgPrice)
Load the ware in the specified amount onto the ship.
|
javafx.beans.property.IntegerProperty |
numberOfSailorsProperty() |
javafx.beans.property.ObjectProperty<IShip> |
parentShipProperty()
Property holding the parent ship in case of a grouping (convoy or group).
|
javafx.beans.binding.BooleanBinding |
passengerPresentProperty()
Binding indicating if a passenger is present.
|
javafx.beans.property.BooleanProperty |
pirateFlagProperty()
Property defining the pirate activit y of the vessel.
|
void |
repair()
Repair the damage
|
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 |
updateHandweapon(int delta)
Update the amount of handweapons on board.
|
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, getWeaponSlots, isAvailable, setAvailable, setName, setOccupiedSpace, setWeaponSlotsgetCaptian, 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 IShippublic javafx.beans.property.BooleanProperty pirateFlagProperty
pirateFlagProperty in interface INavigableVesselgetPirateFlag()public javafx.beans.property.ObjectProperty<IShip> parentShipProperty
parentShipProperty 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
@Autowired private Random rnd
protected EShipUpgrade shipUpgradeLevel
protected String name
private Map<IWare,AmountablePrice<IWare>> loadedWare
private javafx.beans.property.ObjectProperty<IShip> parentShip
private LateIntegerBinding loadBinding
private double topSpeed
@Autowired private AmountableProvider amountableProvider
@Autowired private DependentPropertyInitializer propertyInitializer
private javafx.beans.binding.BooleanBinding passengerPresent
private int loadedHandWeapons
private List<IWeaponSlot> weaponSlots
private int initialValue
private int minNumberOfSailors
private int maxSailors
private int fitness
private javafx.beans.property.IntegerProperty nbSailors
private javafx.geometry.Point2D location
private IShipOwner owner
private boolean available
private int occupiedSpace
private int size
private int reductionLevel1
private int reductionLevel2
private String uuid
private javafx.beans.property.BooleanProperty pirateFlag
protected final void initializeProperties(ShipProperties.Ship 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 INavigableVesselpublic 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 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 leavePassenger()
leavePassenger 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,
boolean destroyWeapon)
INavigableVesseldamage in interface INavigableVesseldamage - amount of damage that is inflicteddestroyWeapon - flag indicating if weapons may be destroyed.private boolean hasWeapons()
private boolean isLargeWeapon(EWeapon weapon)
public void repair()
IShippublic int getLoadableSpace()
INavigableVesselgetLoadableSpace in interface INavigableVesselpublic double getTopSpeed()
INavigableVesselgetTopSpeed in interface INavigableVesselpublic boolean getPirateFlag()
getPirateFlag in interface INavigableVesselpublic void togglePirateFlag()
INavigableVesseltogglePirateFlag in interface INavigableVesselpublic javafx.beans.property.BooleanProperty pirateFlagProperty()
INavigableVesselpirateFlagProperty in interface INavigableVesselgetPirateFlag()public double getCurrentSpeed()
INavigableVesselgetCurrentSpeed in interface INavigableVesselpublic javafx.beans.property.ObjectProperty<IShip> parentShipProperty()
IShipparentShipProperty in interface IShippublic void updateHandweapon(int delta)
IShipupdateHandweapon in interface IShipdelta - difference to be changed.public int getOccupiedSpaceByWeapons()
IShipgetOccupiedSpaceByWeapons in interface IShipCopyright © 2011-2018 Sahits GmbH. All Rights Reserved.