|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectch.sahits.game.openpatrician.model.Player
class Player
| Field Summary | |
|---|---|
private ICareer |
careerLevel
|
private ICompany |
company
|
private LinkedList<IShip> |
fleet
|
private IPersonalData |
personalData
|
private ESocialRank |
rank
|
private ISpouseData |
spouse
|
| Constructor Summary | |
|---|---|
Player(ICity homeTown,
IPersonalData personalData,
long cash,
ESocialRank rank)
|
|
| Method Summary | |
|---|---|
void |
addShip(IShip ship)
Add a new ship for the player |
boolean |
equals(Object obj)
|
List<IBuilding> |
findBuildings(ICity city)
Find all buildings of the player in the city |
List<IBuilding> |
findBuildings(ICity city,
Class<? extends IBuilding> buildingClass)
Find all buildings in the city that are some subtype of the indicated class |
ITradingOffice |
findTradingOffice(ICity city)
Find the trading office of the player in the city. |
ICareer |
getCareerLevel()
Retrieve the career level, which is either defined by EMilitantCareer or EEconomicCareer. |
long |
getCash()
Retrieve the amount of money of the player |
ICompany |
getCompany()
Retrieve the company data |
List<IShip> |
getFleet()
Get a list of all ships |
ICity |
getHometown()
Retrieve the players hometown |
String |
getLastName()
Get a players last name |
String |
getName()
Retrieve the players name |
IPersonalData |
getPersonalData()
Retrieve the personal data of the player |
ESocialRank |
getRank()
Retrieve the social rank of the player |
ISpouseData |
getSpouseData()
Retrieve the personal data of the players spouse. |
int |
hashCode()
|
boolean |
isMale()
Check if the player is male |
void |
marry(ISpouseData spouse)
Marry a spouse |
void |
removeShip(IShip ship)
Remove a ship for the player |
void |
updateCash(int diff)
Add or subtract some cash |
void |
updateRank(ESocialRank rank)
Update to the new social rank |
void |
widow()
Widow and become unmarried again |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final LinkedList<IShip> fleet
private ESocialRank rank
private ICareer careerLevel
private IPersonalData personalData
private ISpouseData spouse
private final ICompany company
| Constructor Detail |
|---|
public Player(ICity homeTown,
IPersonalData personalData,
long cash,
ESocialRank rank)
| Method Detail |
|---|
public String getName()
IPlayer
getName in interface IPlayerpublic String getLastName()
IPlayer
getLastName in interface IPlayerpublic ICity getHometown()
IPlayer
getHometown in interface IPlayerpublic List<IShip> getFleet()
IPlayer
getFleet in interface IPlayerpublic boolean isMale()
IPlayer
isMale in interface IPlayerpublic void addShip(IShip ship)
IPlayer
addShip in interface IPlayerpublic void removeShip(IShip ship)
IPlayer
removeShip in interface IPlayerpublic long getCash()
IPlayer
getCash in interface IPlayerpublic void updateCash(int diff)
updateCash in interface IPlayerdiff - amount of money that is transferredpublic List<IBuilding> findBuildings(ICity city)
IPlayer
findBuildings in interface IPlayerpublic ITradingOffice findTradingOffice(ICity city)
IPlayer
findTradingOffice in interface IPlayer
public List<IBuilding> findBuildings(ICity city,
Class<? extends IBuilding> buildingClass)
IPlayer
findBuildings in interface IPlayerpublic ESocialRank getRank()
IPlayer
getRank in interface IPlayerpublic ICareer getCareerLevel()
IPlayerEMilitantCareer or EEconomicCareer.
getCareerLevel in interface IPlayerpublic void marry(ISpouseData spouse)
spouse - public void widow()
public IPersonalData getPersonalData()
IPlayer
getPersonalData in interface IPlayerpublic ISpouseData getSpouseData()
IPlayer
getSpouseData in interface IPlayerpublic int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic ICompany getCompany()
IPlayer
getCompany in interface IPlayerpublic void updateRank(ESocialRank rank)
IPlayer
updateRank in interface IPlayer
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||