Interface IConvoy
-
- All Superinterfaces:
IGroupableVessel,INavigableVessel
- All Known Implementing Classes:
Convoy
public interface IConvoy extends IGroupableVessel
A convoy is a special representation of a ship. A convoy is put together by a lead ship and optionally other ships. These ships may belong to other players. Any gain or loss will be distributed unto the ships according to their capacity.- Author:
- Andi Hotz, (c) Sahits GmbH, 2011 Created on Dec 17, 2011
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddShip(IShip ship)Add a ship to the convoy.java.util.Map<IPlayer,java.lang.Integer>getCapacityPerOwner()Collect the convoys capacity per player who has ships in the convoy.IShipgetOrlegShip()Retrieve the lead ship of the convoy.java.util.List<IPlayer>getPlayers()Get all players who have a ship in the convoy.java.util.List<IShip>getShips()Retrieve a list of the ships in the convoy.java.util.List<IShip>getShips(IPlayer player)Get all the ships in the convoi that belong to a player.booleanhasWeapons()Though a convoy has always weapons this is only something that is handled on the level of a single ship.booleanisPublicConvoy()Indicates that everyone can join this convoy.voidremoveShip(IShip ship)Remove a ship from the convoy.-
Methods inherited from interface ch.sahits.game.openpatrician.model.ship.INavigableVessel
damage, getAutotrading, getCapacity, getCaptian, getCurrentSpeed, getDamage, getLoadableSpace, getLoadBinding, getLoadedWares, getLocation, getMinNumberOfSailors, getName, getNumberOfSailors, getOwner, getPirateFlag, getSize, getTopSpeed, getUuid, getWare, getWeaponAmount, load, pirateFlagProperty, setAutoTrading, setLocation, togglePirateFlag, unload
-
-
-
-
Method Detail
-
hasWeapons
boolean hasWeapons()
Though a convoy has always weapons this is only something that is handled on the level of a single ship. Therefore this method will always return false.- Returns:
- false
-
getOrlegShip
IShip getOrlegShip()
Retrieve the lead ship of the convoy.- Returns:
- reference to the orleg ship.
-
getShips
java.util.List<IShip> getShips()
Retrieve a list of the ships in the convoy.- Specified by:
getShipsin interfaceIGroupableVessel- Returns:
- list of ships in the convoy.
-
getShips
java.util.List<IShip> getShips(IPlayer player)
Get all the ships in the convoi that belong to a player.- Parameters:
player- who owns the ships- Returns:
- possible empty list of ships.
-
getPlayers
java.util.List<IPlayer> getPlayers()
Get all players who have a ship in the convoy.- Returns:
- list of players.
-
addShip
void addShip(IShip ship)
Add a ship to the convoy.- Parameters:
ship- to be added.
-
removeShip
void removeShip(IShip ship)
Remove a ship from the convoy.- Parameters:
ship- to be removed.
-
getCapacityPerOwner
java.util.Map<IPlayer,java.lang.Integer> getCapacityPerOwner()
Collect the convoys capacity per player who has ships in the convoy.- Returns:
- map of IPlayer to capacity.
-
isPublicConvoy
boolean isPublicConvoy()
Indicates that everyone can join this convoy.- Returns:
- true if the convoy is a public convoy.
-
-