ch.sahits.game.openpatrician.model.ship
Interface IShip

All Known Subinterfaces:
ICog, IConvoy, ICrayer, IHolk, ISnaikka
All Known Implementing Classes:
Cog, Crayer, Holk, Ship, Snaikka

public interface IShip

Model of a ship

Author:
Andi Hotz, (c) Sahits GmbH, 2011 Created on Jun 15, 2011

Method Summary
 void damage(Object damage)
          Damage the ship
 int getCapacity()
          Available capacity of the ship, this represent the free storage in barrels
 int getDamage()
          Retrieve the damage of the ship in percentage
 int getLoad()
          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
 String getName()
          Retrieve the name of the of the ship
 int getSize()
          Total capacity of the ship in barrels
 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 getWare(IWare ware)
          Retrieve the amount of ware loaded
 boolean hasWeapons()
          check if weapons are on board
 boolean isUpgradable()
          Check if the ship can be upgraded
 int load(IWare ware, int amount, int avgPrice)
          Load the ware in the specified amount onto the ship.
 void repair()
          Repair the damage
 void setName(String name)
          Set the ships name
 int unload(IWare ware, int amount)
          Unload the specified quantity of the ware.
 void upgrade()
          Upgrade the ship if it is upgradable
 

Method Detail

getSize

int getSize()
Total capacity of the ship in barrels

Returns:

getCapacity

int getCapacity()
Available capacity of the ship, this represent the free storage in barrels

Returns:

isUpgradable

boolean isUpgradable()
Check if the ship can be upgraded

Returns:

upgrade

void upgrade()
Upgrade the ship if it is upgradable


getName

String getName()
Retrieve the name of the of the ship

Returns:

setName

void setName(String name)
Set the ships name

Parameters:
name -

getLoadedWares

Set<IWare> getLoadedWares()
Retrieve a list of all loaded wares

Returns:

load

int load(IWare ware,
         int amount,
         int avgPrice)
Load the ware in the specified amount onto the ship. The amount uses the size specified by the ware

Parameters:
ware - to be loaded
amount - of items the ware
avgPrice - average price of one item of the ware
Returns:
amount actually loaded

unload

int unload(IWare ware,
           int amount)
Unload the specified quantity of the ware. The amount uses the size specified by the ware

Parameters:
ware - to be unloaded
amount - amount of items of ware to unload
Returns:
amount of the ware unloaded

getDamage

int getDamage()
Retrieve the damage of the ship in percentage

Returns:

damage

void damage(Object damage)
Damage the ship

Parameters:
damage -

repair

void repair()
Repair the damage


getUpgradeSpaceReduction

int getUpgradeSpaceReduction()
Retrieve the reduction of the load capacity based on the upgrade level. The reduction is in barrel that reduces the initial size

Returns:
reduction in barrels

getLoad

int getLoad()
Retrieve the amount of load in barrels that is loaded in actual wares (no wappen or crew)

Returns:
amount of loaded wares in barrels

getWare

AmountablePrice getWare(IWare ware)
Retrieve the amount of ware loaded

Parameters:
ware -
Returns:

hasWeapons

boolean hasWeapons()
check if weapons are on board

Returns:

getValue

int getValue()
Retrieve the current value of the ship without its cargo

Returns:


Copyright © 2011-2012 Sahits GmbH. All Rights Reserved.