public class Convoy extends Object implements IConvoy
| Type | Property and Description |
|---|---|
javafx.beans.property.BooleanProperty |
pirateFlag
Property defining the pirate activit y of the vessel.
|
| Modifier and Type | Field and Description |
|---|---|
private AmountableProvider |
amountableProvider |
private LateIntegerBinding |
loadBinding
Binding representing the current load.
|
private IShip |
orlegShip |
private boolean |
publicConvoy |
private Random |
rnd |
private com.google.common.collect.Multimap<IPlayer,IShip> |
ships |
| Constructor and Description |
|---|
Convoy(IShip orlegShip,
boolean publicConvoy) |
| Modifier and Type | Method and Description |
|---|---|
void |
addShip(IShip ship)
Add a ship to the convoy.
|
private LateIntegerBinding |
createLoadBinding() |
void |
damage(int damage,
boolean destroyWeapon)
Apply the damage to all ships.
|
int |
getCapacity()
Available capacity of the ship, this represent the free storage in barrels
|
Map<IPlayer,Integer> |
getCapacityPerOwner()
Collect the convoys capacity per player who has ships
in the convoy.
|
Optional<ICaptain> |
getCaptian()
Retrieve the captain of the Orleg ship.
|
double |
getCurrentSpeed()
Current top speed of the ship.
|
int |
getDamage()
Retrieve the damage of the ship that is damaged the most.
|
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()
The name of the convoy is the name of the Orleg ship.
|
int |
getNumberOfSailors()
Retrieve the number of sailors on the ship.
|
IShip |
getOrlegShip()
Retrieve the lead ship of the convoy.
|
IShipOwner |
getOwner()
Retrieve the owner of the ship.
|
boolean |
getPirateFlag()
Gets the value of the property pirateFlag.
|
List<IPlayer> |
getPlayers()
Get all players who have a ship in the convoy.
|
List<IShip> |
getShips()
Retrieve a list of the ships in the convoy.
|
List<IShip> |
getShips(IPlayer player)
Get all the ships in the convoi that belong to a player.
|
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
|
boolean |
hasWeapons()
Though a convoy has always weapons this is only something that
is handled on the level of a single ship.
|
int |
load(IWare ware,
int amount,
int avgPrice)
The wares are loaded onto the ships in the convoy
in the iteration order.
|
private LateIntegerBinding |
loadbinding() |
javafx.beans.property.BooleanProperty |
pirateFlagProperty()
Property defining the pirate activit y of the vessel.
|
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 wares from the ships in the convoy in the iteration
order.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisPublicConvoypublic javafx.beans.property.BooleanProperty pirateFlagProperty
pirateFlagProperty in interface INavigableVesselgetPirateFlag()@Autowired private Random rnd
@Autowired private AmountableProvider amountableProvider
private final IShip orlegShip
private final boolean publicConvoy
private LateIntegerBinding loadBinding
public Convoy(IShip orlegShip, boolean publicConvoy)
public boolean hasWeapons()
IConvoyhasWeapons in interface IConvoypublic IShip getOrlegShip()
IConvoygetOrlegShip in interface IConvoypublic List<IShip> getShips()
IConvoygetShips in interface IConvoygetShips in interface IGroupableVesselprivate LateIntegerBinding loadbinding()
public void addShip(IShip ship)
IConvoypublic void removeShip(IShip ship)
IConvoyremoveShip in interface IConvoyship - to be removed.private LateIntegerBinding createLoadBinding()
public int getSize()
INavigableVesselgetSize in interface INavigableVesselpublic int getCapacity()
INavigableVesselgetCapacity in interface INavigableVesselpublic String getName()
getName in interface INavigableVesselpublic 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 warepublic int unload(IWare ware, int amount)
unload in interface INavigableVesselware - to be unloadedamount - amount of items of ware to unloadpublic int getDamage()
getDamage in interface INavigableVesselpublic void damage(int damage,
boolean destroyWeapon)
damage in interface INavigableVesseldamage - average damage by shipdestroyWeapon - flag indicating if weapons may be destroyed.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()
getCaptian in interface INavigableVesselpublic int getWeaponAmount(IWeapon weaponType)
INavigableVesselgetWeaponAmount in interface INavigableVesselweaponType - SWORD | BOW | CROSSBOW | MUSKETpublic 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 List<IShip> getShips(IPlayer player)
IConvoypublic List<IPlayer> getPlayers()
IConvoygetPlayers in interface IConvoypublic Map<IPlayer,Integer> getCapacityPerOwner()
IConvoygetCapacityPerOwner in interface IConvoypublic 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()
getPirateFlag in interface INavigableVesselpublic void togglePirateFlag()
INavigableVesseltogglePirateFlag in interface INavigableVesselpublic javafx.beans.property.BooleanProperty pirateFlagProperty()
INavigableVesselpirateFlagProperty in interface INavigableVesselgetPirateFlag()Copyright © 2011-2018 Sahits GmbH. All Rights Reserved.