Interface IPlayer
-
- All Superinterfaces:
ICitizen
,ICreditor
,IShipOwner
- All Known Subinterfaces:
IAIPlayer
,IHumanPlayer
- All Known Implementing Classes:
AIPlayer
,HumanPlayer
,Player
public interface IPlayer extends ICitizen, IShipOwner
Base player in the game.- Author:
- Andi Hotz, (c) Sahits GmbH, 2011 Created on Jun 15, 2011
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addSelectableVessel(INavigableVessel vessel)
Add a selectable vessel to the list.void
addShip(IShip ship)
Add a new ship for the playerjava.util.List<IBuilding>
findBuildings(ICity city)
Find all buildings of the player in the city<T extends IBuilding>
java.util.List<T>findBuildings(ICity city, java.lang.Class<T> buildingClass)
Find all buildings in the city that are some subtype of the indicated classjava.util.List<INavigableVessel>
findShips(ICity city)
Find all ships in a cityjava.util.Optional<ITradingOffice>
findTradingOffice(ICity city)
Find the trading office of the player in the city.ICareer
getCareerLevel()
Retrieve the career level, which is either defined byEMilitantCareer
orEEconomicCareer
.java.util.List<IChild>
getChildren()
Retrieve all children.ICompany
getCompany()
Retrieve the company dataint
getCriminalDrive()
Retrieve the value indicating the criminal drive of the player.java.util.List<IShip>
getFleet()
Get a list of all shipsIPersonalData
getPersonalData()
Retrieve the personal data of the playerMapSegmentedImage
getSegmentedMap()
Retrieve the segmented image map.java.util.List<INavigableVessel>
getSelectableVessels()
Provide a different view on the fleet by containing all the vessels that can be selected.java.util.Optional<ISpouseData>
getSpouseData()
Retrieve the personal data of the players spouse.java.lang.String
getUuid()
Retrieve the UUID identifing this player.void
marry(ISpouseData spouse)
Conclude the marriage.void
removeSelectableVessel(INavigableVessel vessel)
Remove a selectable vessel from the list.void
removeShip(IShip ship)
Remove a ship for the playervoid
setCareerLevel(ICareer career)
Set the current career level.void
setSegmentedMap(MapSegmentedImage mapSegments)
Set or unset the image for a segmented map (treasure or pirate hideout).void
spouseDies()
Widow and become unmarried again.void
updateCrimialDrive(int value)
Update the new value indicating the level of criminallity of the playervoid
updateRank(ESocialRank rank)
Update to the new social rank-
Methods inherited from interface ch.sahits.game.openpatrician.model.ICitizen
getHometown, getLastName, getName, getRank
-
Methods inherited from interface ch.sahits.game.openpatrician.model.city.ICreditor
receiveSum
-
Methods inherited from interface ch.sahits.game.openpatrician.model.people.IShipOwner
getLastName, getName
-
-
-
-
Method Detail
-
getPersonalData
IPersonalData getPersonalData()
Retrieve the personal data of the player- Returns:
- personal data of the player.
-
getSpouseData
java.util.Optional<ISpouseData> getSpouseData()
Retrieve the personal data of the players spouse.- Returns:
- Optional spouse data. Empty if the player is not married.
-
getCompany
ICompany getCompany()
Retrieve the company data- Returns:
- company of the player.
-
getFleet
java.util.List<IShip> getFleet()
Get a list of all ships- Returns:
- list of the players ships.
-
getSelectableVessels
java.util.List<INavigableVessel> getSelectableVessels()
Provide a different view on the fleet by containing all the vessels that can be selected.- Returns:
- list of vessels that can be activated.
-
addSelectableVessel
void addSelectableVessel(INavigableVessel vessel)
Add a selectable vessel to the list.- Parameters:
vessel
- to be added
-
removeSelectableVessel
void removeSelectableVessel(INavigableVessel vessel)
Remove a selectable vessel from the list.- Parameters:
vessel
- to be removed.
-
findShips
java.util.List<INavigableVessel> findShips(ICity city)
Find all ships in a city- Parameters:
city
- in which to fin ships- Returns:
- list of vessels in the
city
-
addShip
void addShip(IShip ship)
Add a new ship for the player- Parameters:
ship
- to be added to the fleet.
-
removeShip
void removeShip(IShip ship)
Remove a ship for the player- Parameters:
ship
- to be removed from the fleet.
-
findBuildings
java.util.List<IBuilding> findBuildings(ICity city)
Find all buildings of the player in the city- Parameters:
city
- where to search for buildings.- Returns:
- list of buildings in
city
owned by the player.
-
findTradingOffice
java.util.Optional<ITradingOffice> findTradingOffice(ICity city)
Find the trading office of the player in the city.- Parameters:
city
- where to look for a trading office- Returns:
- Optional trading office. Empty if there is none in the
city
.
-
findBuildings
<T extends IBuilding> java.util.List<T> findBuildings(ICity city, java.lang.Class<T> buildingClass)
Find all buildings in the city that are some subtype of the indicated class- Parameters:
city
- in which to look for buildingsbuildingClass
- class of the building that is searched- Returns:
- type cast list of the buildings in
city
.
-
updateRank
void updateRank(ESocialRank rank)
Update to the new social rank- Parameters:
rank
- new social rank.
-
getCareerLevel
ICareer getCareerLevel()
Retrieve the career level, which is either defined byEMilitantCareer
orEEconomicCareer
.- Returns:
- current career level.
-
setCareerLevel
void setCareerLevel(ICareer career)
Set the current career level.- Parameters:
career
- new career level
-
setSegmentedMap
void setSegmentedMap(MapSegmentedImage mapSegments)
Set or unset the image for a segmented map (treasure or pirate hideout).- Parameters:
mapSegments
- to be set or unset (null)
-
getSegmentedMap
MapSegmentedImage getSegmentedMap()
Retrieve the segmented image map.- Returns:
- segmented image map
-
marry
void marry(ISpouseData spouse)
Conclude the marriage.- Parameters:
spouse
- data for the spouse.
-
spouseDies
void spouseDies()
Widow and become unmarried again.
-
getChildren
java.util.List<IChild> getChildren()
Retrieve all children.- Returns:
- list of children
-
updateCrimialDrive
void updateCrimialDrive(int value)
Update the new value indicating the level of criminallity of the player- Parameters:
value
- new criminal drive value.
-
getCriminalDrive
int getCriminalDrive()
Retrieve the value indicating the criminal drive of the player.- Returns:
- criminal drive
-
getUuid
java.lang.String getUuid()
Retrieve the UUID identifing this player.- Returns:
- UUID of the player.
-
-