|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectj4cevo.MemoryBasedObject
j4cevo.Player
Player is the root for all j4cEvo managed objects - according get
methods are provided. Additionally Player has methods to control nationwide
stuff: eg. what is researched, government and taxrate.
| Nested Class Summary | |
static class |
Player.ChangeAdapter
|
static interface |
Player.ChangeListener
|
class |
Player.Domain
|
static class |
Player.ListChangeAdapter
|
static interface |
Player.ListChangeListener
|
class |
Player.Movement
A Movement has all information about a movement that occurs during an enemy turn. |
static interface |
Player.Research
Research contains the information about the research of a particular advance. |
class |
Player.Wonder
Wonders have different effects, see the game rules. |
| Constructor Summary | |
Player()
|
|
| Method Summary | |
int |
acceptContact()
Accepts diplomatic contact with enemy who tried to contact this player |
int |
acceptOffer()
Accepts latest offer of negotiation opponent. |
int |
breakNegotiation()
Unagreed break of negotiation |
int |
cancelTreaty()
Cancels current treaty with the enemy who was contacted lately. |
boolean |
canPerform(Job job,
Tile location)
Tests, whether all required advances and wonders are owned, to perform a job at a location |
void |
continueTurn()
continueTurn is called after ending a negotiation call
deactivation-code before returning |
void |
createLogger()
hook for subclasses which want to use a different logger. |
int |
createModel(Domain domain)
Create a model for a domain. |
void |
DebugMessage(java.lang.String s)
Sends a debug message of level 1 to the server |
Age |
getAge()
|
int |
getAnarchyStart()
Gets the turn, when Anarchy started or 0 if there is no anarchy actually |
Brain |
getBrain()
|
int |
getBuildCostModifier()
|
ListenerSlot |
getChangeSlot()
gets the slot for ChangeListener by convention there should be a local ChangeListener class |
Chart |
getChart(int type)
request a chart |
java.util.Collection |
getCities()
Gets all cities |
City |
getCity(Tile destination)
|
int |
getCredibility()
|
Player.Research |
getCurrentResearch()
Gets advance researched. |
Model |
getCurrentResearchModel()
|
int |
getDifficulty()
|
Player.Domain |
getDomain(Domain domain)
|
java.util.Collection |
getEnemies()
Gets collection with all enemies, even dead ones |
java.util.Collection |
getEnemyUnits()
|
int |
getExpectedIncome()
|
int |
getExpectedResearch()
|
Government |
getGovernment()
Get the current government |
int |
getIndex()
|
ListenerSlot |
getListChangeSlot()
|
java.util.logging.Logger |
getLogger()
The logger for this player. j4cEvo will use this logger to log events happening during this players turn. |
int |
getLuxuryRate()
Gets the luxury rate in percent, each 3 luxury points in a city make one unhappy citizen happy |
Map |
getMap()
|
int |
getMaxCredibility()
maximum credibility still possible to achieve |
java.util.List |
getModels()
|
int |
getMoney()
Gets the actual amount of money |
int |
getNrPlayer()
|
int |
getOptionFlags()
Gets the options turned on in the Manipulationmenu. |
static Player |
getPlayer()
|
int |
getProductionCost(Improvement improvement)
|
int |
getRequiredResearchPoints()
Gets the required research points for currently researched advance or model |
Player.Research |
getResearchFor(Advance advance)
|
int |
getResearchPointsAccumulated()
|
int |
getResearchRate()
Gets the research rate in percent |
ShipInfo |
getShipInfo()
|
int |
getStorageSizePerCitizen()
|
int |
getTaxRate()
Gets the tax rate in percent |
int |
getTributeDefined()
defined each turn payment with other nations (+ received, - payed) |
int |
getTributePaid()
last turn payment with other nations (+ received, - payed) |
int |
getTurn()
Gets the current turn |
Unit |
getUnit(int key)
Gets the unit for a key |
java.util.List |
getUnits()
Gets all units of this player |
int |
getWhatHappend()
Gets flag what has happened last turn |
Player.Wonder |
getWonder(Wonder wonder)
For some unknown reason wonder is not provided as part of GameData but for each Player. |
ByteMap |
getZOCMap()
|
boolean |
hasHappend(int flag)
Gets whether event has happend |
boolean |
hasNationalProject(Improvement improvement)
Checks whether a National Project is built already ( National Projects can be built once per player) |
boolean |
isAlive()
Queries whether this Player is still alive |
int |
makeOffer(Offer offer)
Makes an offer to the enemy. |
int |
noticeDecision()
Notices latest decision of negotiation opponent. |
int |
rejectContact()
Refuses diplomatic contact with enemy who tried to contact this player |
int |
researchModel()
Starts research of a prior created model instead of researching an advance. |
int |
setGovernment(Government government)
Set government form. |
int |
setModelCapability(Capability capability,
int value)
Sets the value for a capability of the model that will be researched Capabilities are available if the required advances are researched. |
int |
setRates(int tax,
int luxury)
Sets tax and luxury rates. |
int |
startAnarchy()
Changes to anarchy. |
int |
stealAdvance(Advance advance)
After capturing a city, this command might be possible, indicated by the phStealTech flag in getWhatHappened. |
java.lang.String |
toString()
|
int |
turnDone()
Signals the server this turn is finally done |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Player()
| Method Detail |
public int setGovernment(Government government)
government - The new government value
startAnarchy()
public int setModelCapability(Capability capability,
int value)
capability - the requested capabilityvalue - The new value for the capability
researchModel()
public int setRates(int tax,
int luxury)
tax - percent of trade to be converted to moneyluxury - percent of trade to be converted to luxury points
public Age getAge()
getAge in interface PlayerBasepublic int getAnarchyStart()
setGovernment(j4cevo.Government),
startAnarchy()public Brain getBrain()
public int getBuildCostModifier()
public ListenerSlot getChangeSlot()
ChangeInformer
getChangeSlot in interface ChangeInformerPlayer.ChangeListenerpublic Chart getChart(int type)
type - one ofProtocol.ChartTypepublic java.util.Collection getCities()
public City getCity(Tile destination)
public int getCredibility()
getCredibility in interface PlayerBasepublic Player.Research getCurrentResearch()
public Model getCurrentResearchModel()
public int getDifficulty()
getDifficulty in interface PlayerBasepublic Player.Domain getDomain(Domain domain)
public java.util.Collection getEnemies()
public java.util.Collection getEnemyUnits()
public int getExpectedIncome()
public int getExpectedResearch()
public Government getGovernment()
getGovernment in interface PlayerBasepublic int getIndex()
getIndex in interface PlayerBasepublic ListenerSlot getListChangeSlot()
Player.ListChangeListenerpublic final java.util.logging.Logger getLogger()
createLogger()public int getLuxuryRate()
public Map getMap()
public int getMaxCredibility()
public java.util.List getModels()
getModels in interface PlayerBasepublic int getMoney()
public int getNrPlayer()
public int getOptionFlags()
Manipulationmenu.
getOptionFlags() & Protocol.tfUncoverProtocol.TestFlagspublic int getProductionCost(Improvement improvement)
public int getRequiredResearchPoints()
public Player.Research getResearchFor(Advance advance)
public int getResearchPointsAccumulated()
public int getResearchRate()
public ShipInfo getShipInfo()
getShipInfo in interface PlayerBasepublic int getStorageSizePerCitizen()
public int getTaxRate()
public int getTributeDefined()
public int getTributePaid()
public int getTurn()
public Unit getUnit(int key)
key - of the unit
public java.util.List getUnits()
getUnits in interface PlayerBasepublic int getWhatHappend()
Protocol.PlayerHappenedpublic Player.Wonder getWonder(Wonder wonder)
wonder - the wonder
Protocol.Wonderspublic ByteMap getZOCMap()
public boolean isAlive()
isAlive in interface PlayerBasepublic void DebugMessage(java.lang.String s)
s - the string to display in the server debug windowpublic int acceptContact()
public int acceptOffer()
public int breakNegotiation()
public final boolean canPerform(Job job,
Tile location)
job - location - @type.rulepublic int cancelTreaty()
public void continueTurn()
continueTurn is called after ending a negotiation call
deactivation-code before returning
finish turn,
start negotiationpublic void createLogger()
public int createModel(Domain domain)
domain -
setModelCapability(j4cevo.Capability, int),
researchModel()public final boolean hasHappend(int flag)
flag - for the event in question
Protocol.PlayerHappenedpublic boolean hasNationalProject(Improvement improvement)
improvement -
PlayerCity.hasImprovement(j4cevo.Improvement)public int makeOffer(Offer offer)
offer -
public int noticeDecision()
public int rejectContact()
public int researchModel()
createModel(Domain domain),
setModelCapability(j4cevo.Capability, int)public int startAnarchy()
setGovernment(j4cevo.Government)public int stealAdvance(Advance advance)
advance - the advance to steal
getWhatHappend()public java.lang.String toString()
public int turnDone()
public static Player getPlayer()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||