Interface ICaptain
-
- All Superinterfaces:
IPerson
- All Known Implementing Classes:
CaptainState
public interface ICaptain extends IPerson
Interface describing a captain- Author:
- Andi Hotz, (c) Sahits GmbH, 2013 Created on Jan 19, 2013
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidassignToShip(IShip ship)Assign a captain to a ship.intgetAge()Current age of the captainjava.util.Optional<IShip>getAssignedShip()Get the ship the captain is assigned to.intgetFightSkillLevel()Retrieve the level in sea fights between [0,5]java.lang.StringgetName()Retrieve the name of the captainintgetNavigationSkillLevel()Retrieve the level in navigation between [0,5]intgetSalary()Retrieve the salary per day.intgetTradingSkillLevel()Retrieve the level in trading between [0,5]voidupdatedSailedDistance(int distance)Add the sailed distance to the totalvoidupdateFightWon()Increase the number of won fights.voidupdateProfit(int profit)Add the profit the total profit.booleanupgradeToNextFightingLevel()If possible upgrade the captain fight skill to the next level.booleanupgradeToNextNavigationLevel()If possible upgrade the captain to the next level on navigation skill.booleanupgradeToNextTradeLevel()Increase the experiance level by one.
-
-
-
Method Detail
-
getAge
int getAge()
Current age of the captain- Returns:
- age of the captain
-
getName
java.lang.String getName()
Retrieve the name of the captain- Returns:
- name of the captain
-
getSalary
int getSalary()
Retrieve the salary per day.- Returns:
- salaray of the captain
-
getTradingSkillLevel
int getTradingSkillLevel()
Retrieve the level in trading between [0,5]- Returns:
- trading skill of the captain.
-
updateProfit
void updateProfit(int profit)
Add the profit the total profit.- Parameters:
profit- additional profit
-
updatedSailedDistance
void updatedSailedDistance(int distance)
Add the sailed distance to the total- Parameters:
distance- additional distance
-
upgradeToNextNavigationLevel
boolean upgradeToNextNavigationLevel()
If possible upgrade the captain to the next level on navigation skill.- Returns:
- true if upgrade happened
-
updateFightWon
void updateFightWon()
Increase the number of won fights.
-
upgradeToNextFightingLevel
boolean upgradeToNextFightingLevel()
If possible upgrade the captain fight skill to the next level.- Returns:
- true if an upgrade happened
-
upgradeToNextTradeLevel
boolean upgradeToNextTradeLevel()
Increase the experiance level by one. The highest level i 5.- Returns:
- true if upgrade happened.
-
getNavigationSkillLevel
int getNavigationSkillLevel()
Retrieve the level in navigation between [0,5]- Returns:
- navigation skill of the captain
-
getFightSkillLevel
int getFightSkillLevel()
Retrieve the level in sea fights between [0,5]- Returns:
- fighting skill of the captain.
-
getAssignedShip
java.util.Optional<IShip> getAssignedShip()
Get the ship the captain is assigned to.- Returns:
- absent if the captain is not assigned to any ship.
-
assignToShip
void assignToShip(IShip ship)
Assign a captain to a ship.- Parameters:
ship- to which the captain is assigned.
-
-