| Modifier and Type | Field and Description |
|---|---|
private java.time.LocalDateTime |
birthDate |
private Date |
date |
private DateService |
dateService |
private int |
fightingSkill |
private static RandomNameLoader |
firstNameLoader |
private static RandomNameLoader |
lastNameLoader |
private String |
name |
private int |
navigationSkill |
private Random |
rnd |
private long |
sailedDistance |
private int |
salary |
private Optional<IShip> |
ship |
private static com.google.common.collect.Range<Integer> |
skillRange |
private int |
totalProfit |
private int |
tradingSkill |
private static Map<Integer,Integer> |
UPGRADE_FIGHT_LIMIT_LEVEL
Limits for the level that have to be reached before upgrading fighting skill.
|
private static Map<Integer,Integer> |
UPGRADE_NAVIGATION_LIMIT_LEVEL
Limits for the level that have to be reached before upgrading navigation skill.
|
private static Map<Integer,Integer> |
UPGRADE_TRADE_LIMIT_LEVEL
Limits for the level that have to be reached before upgrading.
|
private int |
wonFights |
| Constructor and Description |
|---|
CaptainState() |
| Modifier and Type | Method and Description |
|---|---|
void |
assignToShip(IShip ship)
Assign a captain to a ship.
|
int |
getAge()
Current age of the captain
|
Optional<IShip> |
getAssignedShip()
Get the ship the captain is assigned to.
|
int |
getFightSkillLevel()
Retrieve the level in sea fights between [0,5]
|
String |
getName()
Retrieve the name of the captain
|
int |
getNavigationSkillLevel()
Retrieve the level in navigation between [0,5]
|
int |
getSalary()
Retrieve the salary per day.
|
int |
getTradingSkillLevel()
Retrieve the level in trading between [0,5]
|
private void |
init() |
private void |
setFightSkillLevel(int level)
Set the new fight skill level between [0..5]
|
private void |
setNavigationSkillLevel(int level)
Set the new navigation skill level between [0..5]
|
void |
setSalary(int salary)
Set the new salary
|
private void |
setTradingSkillLevel(int level)
Set the new trading skill level between [0..5]
|
void |
updatedSailedDistance(int distance)
Add the sailed distance to the total
|
void |
updateFightWon()
Increase the number of won fights.
|
void |
updateProfit(int profit)
Add the profit the total profit.
|
boolean |
upgradeToNextFightingLevel()
If possible upgrade the captain fight skill to the next level.
|
boolean |
upgradeToNextNavigationLevel()
If possible upgrade the captain to the next level on navigation skill.
|
boolean |
upgradeToNextTradeLevel()
Increase the experiance level by one.
|
@Autowired private Date date
@Autowired private DateService dateService
@Autowired private Random rnd
private java.time.LocalDateTime birthDate
private String name
private int salary
private int tradingSkill
private int navigationSkill
private int fightingSkill
private int totalProfit
private long sailedDistance
private int wonFights
private static final com.google.common.collect.Range<Integer> skillRange
private static final Map<Integer,Integer> UPGRADE_NAVIGATION_LIMIT_LEVEL
private static final Map<Integer,Integer> UPGRADE_FIGHT_LIMIT_LEVEL
private static final Map<Integer,Integer> UPGRADE_TRADE_LIMIT_LEVEL
private static RandomNameLoader firstNameLoader
private static RandomNameLoader lastNameLoader
@PostConstruct private void init()
public int getAge()
ICaptainpublic String getName()
ICaptainpublic int getSalary()
ICaptainpublic int getTradingSkillLevel()
ICaptaingetTradingSkillLevel in interface ICaptainpublic int getNavigationSkillLevel()
ICaptaingetNavigationSkillLevel in interface ICaptainpublic int getFightSkillLevel()
ICaptaingetFightSkillLevel in interface ICaptainprivate void setTradingSkillLevel(int level)
level - private void setNavigationSkillLevel(int level)
level - private void setFightSkillLevel(int level)
level - public void setSalary(int salary)
salary - public void assignToShip(IShip ship)
ICaptainassignToShip in interface ICaptainship - to which the captain is assigned.public Optional<IShip> getAssignedShip()
getAssignedShip in interface ICaptainpublic boolean upgradeToNextTradeLevel()
ICaptainupgradeToNextTradeLevel in interface ICaptainpublic void updateProfit(int profit)
ICaptainupdateProfit in interface ICaptainprofit - additional profitpublic void updatedSailedDistance(int distance)
ICaptainupdatedSailedDistance in interface ICaptaindistance - additional distancepublic boolean upgradeToNextNavigationLevel()
ICaptainupgradeToNextNavigationLevel in interface ICaptainpublic void updateFightWon()
ICaptainupdateFightWon in interface ICaptainpublic boolean upgradeToNextFightingLevel()
ICaptainupgradeToNextFightingLevel in interface ICaptainCopyright © 2011-2018 Sahits GmbH. All Rights Reserved.