| Type | Property and Description |
|---|---|
javafx.beans.property.IntegerProperty |
numberOfSailors |
| Modifier and Type | Field and Description |
|---|---|
private boolean |
available |
private com.google.common.base.Optional<ICaptain> |
captian |
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 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 IPlayer |
owner |
private com.google.common.base.Optional<IPerson> |
passenger |
private boolean |
piratingShip |
private int |
reductionLevel1 |
private int |
reductionLevel2 |
private static double |
SAILOR_NEEDS_SPACE
Amount of barrels space a sailor needs
|
protected EShipUpgrade |
shipUpgradeLevel
State of the design standard level
|
private IShipWeaponsLocation |
shipWeaponsLocation |
private int |
size
Size in barrels
|
| Modifier | Constructor and Description |
|---|---|
(package private) |
Ship(int initialValue,
int minNumberOfSailors,
int maxSailors)
Constructor in place for backward compatability.
|
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 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
|
int |
getLoad()
Deprecated.
|
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.
|
IPlayer |
getOwner()
Retrieve the owner of the ship.
|
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 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() |
void |
setCaptain(ICaptain captain)
Set the captain on the ship
|
void |
setNumberOfSailors(int nbSailors)
Sets the value of the property numberOfSailors.
|
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, waitdamage, getCaptian, getDamage, getLocation, getMinNumberOfSailors, getName, getOccupiedSpace, getPassenger, getShipType, getShipUpgradeLevel, getShipWeaponsLocation, getSize, isAvailable, isPiratingShip, repair, setAvailable, setLocation, setName, setOccupiedSpace, setOwnernumberOfSailorsProperty in interface IShipprivate static final double SAILOR_NEEDS_SPACE
protected EShipUpgrade shipUpgradeLevel
protected String name
private Map<IWare,AmountablePrice<IWare>> loadedWare
private LateIntegerBinding loadBinding
private IShipWeaponsLocation shipWeaponsLocation
private final int initialValue
private final int minNumberOfSailors
private final int maxSailors
private com.google.common.base.Optional<ICaptain> captian
private com.google.common.base.Optional<IPerson> passenger
protected int fitness
private javafx.beans.property.IntegerProperty nbSailors
private javafx.geometry.Point2D location
private IPlayer owner
private boolean piratingShip
private boolean available
private int occupiedSpace
private int size
private int reductionLevel1
private int reductionLevel2
protected Ship(Properties shipConfiguration)
Ship(int initialValue,
int minNumberOfSailors,
int maxSailors)
initialValue - minNumberOfSailors - maxSailors - 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()
IShipgetLoadedWares in interface IShippublic int load(IWare ware, int amount, int avgPrice)
private int ensureCapacity(int amount)
amount - public int unload(IWare ware, int amount)
@Deprecated public int getLoad()
IShipprivate int internalLoadCalculation()
public javafx.beans.binding.IntegerBinding getLoadBinding()
IShipgetLoadBinding in interface IShipprotected void clearLoadedWares()
public AmountablePrice<IWare> getWare(IWare ware)
IShipprivate 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 IShippublic void setNumberOfSailors(int nbSailors)
setNumberOfSailors in interface IShipnbSailors - .public javafx.beans.property.IntegerProperty numberOfSailorsProperty()
numberOfSailorsProperty in interface IShippublic void move(IWeapon weaponType, int amount)
IShippublic int getWeaponAmount(IWeapon weaponType)
IShipgetWeaponAmount in interface IShipweaponType - SWORD | BOW | CROSSBOW | MUSKETpublic void addPassenger(IPerson passanger)
addPassenger in interface IShippassanger - public IPlayer getOwner()
IShippublic void leavePassanger()
leavePassanger in interface IShippublic int getCapacity()
IShipgetCapacity in interface IShippublic int getUpgradeSpaceReduction()
IShipgetUpgradeSpaceReduction in interface IShipCopyright © 2011-2015 Sahits GmbH. All Rights Reserved.