|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdd.sim.SimObject
dd.sim.GameRoot
The GameRoot contains all of the other objects that make up the game, including the player objects, proposals, scenario, game state, and the map. Other than the accessors for each component, it's mostly just a normal SimObject. It also has a number of functions that require access from the "top-level" of the game data. Functions with no javadoc should be self-explanatory.
Field Summary |
Fields inherited from class dd.sim.SimObject |
attributes |
Constructor Summary | |
GameRoot()
|
Method Summary | |
void |
addNewProposal(java.lang.String family)
Creates a new Proposal of the given family by reading it in from xml, gets an ID for it from the TurnServer and sets it, and stores the Proposal in the registry. |
boolean |
alwaysTooCostly(Proposal prop)
|
void |
castVote(Player player,
Proposal proposal,
int vote)
|
void |
createProposalsPage()
Creates the (HTML) help page that has a link to each proposal available this round and stores it as a String in the proposalsPage attribute. |
boolean |
currentlyTooCostly(Proposal prop)
|
java.util.Collection |
getActiveProposals()
|
Registry |
getConnectedPlayers()
|
static CostTable |
getCostTable()
|
java.util.List |
getCurrentProposals()
Returns a sorted List of the Proposals in the ProposalRegistry that have status STATUS_NEW or status STATUS_PLAYED. |
java.util.List |
getFailedProposals()
Returns a sorted List of the Proposals in the ProposalRegistry that have status STATUS_FAILED. |
java.lang.String |
getGameName()
|
int |
getHumanPlayers()
|
java.util.List |
getInactiveProposals()
|
java.util.List |
getNewProposals()
Returns a sorted List of the Proposals in the ProposalRegistry that have status STATUS_NEW. |
Player |
getOwner(Proposal prop)
|
java.util.List |
getPassedProposals()
Returns a sorted List of the Proposals in the ProposalRegistry that have status STATUS_PASSED. |
java.lang.String |
getPhase()
|
java.util.List |
getPlayedProposals()
Returns a sorted List of the Proposals in the ProposalRegistry that have status STATUS_PLAYED. |
Registry |
getPlayers()
|
java.lang.String |
getPlayerStatus(java.lang.String pid)
|
Registry |
getProposalRegistry()
|
java.util.Collection |
getProposals()
|
java.lang.String |
getProposalsPage()
|
java.lang.String |
getProposalSummaries()
Creates an HTML string containing an unordered list of the titles and short descriptions of the proposals in the registry with status STATUS_NEW. |
float |
getRawScore(java.lang.String metric)
|
float |
getRawScore(java.lang.String metric,
Layer l)
|
Scenario |
getScenario()
|
float |
getScore(java.lang.String metric)
|
float |
getScore(java.lang.String metric,
Layer l)
|
java.util.List |
getStatusProposals(java.lang.String status)
Returns a sorted List of the Proposals in the ProposalRegistry that have the given status. |
java.lang.String |
getTurnSummary()
Prints a summary of the turn that just finished in HTML format. |
Proposal |
getUpForVote()
|
java.lang.String |
htmlScoreBars()
|
java.lang.String |
htmlScoreBars(boolean all)
|
static void |
main(java.lang.String[] args)
|
void |
nextTurn()
Calls reset() on each Player, resetting their votes. |
Player |
player(java.lang.String pid)
|
Proposal |
proposal(java.lang.String pid)
|
void |
resetPlayerStatus()
|
java.lang.String |
roleForPlayer(int turnNumber)
|
void |
setGameName(java.lang.String name)
|
void |
setHumanPlayers(int num)
|
void |
setPhase(java.lang.String phase)
|
void |
setPlayerStatus(java.lang.String pid,
java.lang.String status)
|
void |
setProposals(Registry proposals)
|
void |
setUpForVote(Proposal p)
Sets the "upForVote" attribute to the pid of the given proposal and does appropriate things with the one bonus vote players always get. |
void |
spendRemainingBudget()
|
static GameRoot |
tutorial()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public GameRoot()
Method Detail |
public static CostTable getCostTable()
public static GameRoot tutorial()
public java.util.Collection getProposals()
public Registry getProposalRegistry()
public void setProposals(Registry proposals)
public Registry getPlayers()
public void setGameName(java.lang.String name)
public java.lang.String getGameName()
public void setHumanPlayers(int num)
public int getHumanPlayers()
public Registry getConnectedPlayers()
public Scenario getScenario()
public void nextTurn()
public void addNewProposal(java.lang.String family)
public void createProposalsPage()
public java.lang.String getProposalsPage()
public java.lang.String getProposalSummaries()
public void castVote(Player player, Proposal proposal, int vote)
public Player getOwner(Proposal prop)
public Proposal getUpForVote()
public void setUpForVote(Proposal p)
public void spendRemainingBudget()
public boolean alwaysTooCostly(Proposal prop)
public boolean currentlyTooCostly(Proposal prop)
public Proposal proposal(java.lang.String pid)
public Player player(java.lang.String pid)
public void setPhase(java.lang.String phase)
public java.lang.String getPhase()
public void setPlayerStatus(java.lang.String pid, java.lang.String status)
public void resetPlayerStatus()
public java.lang.String getPlayerStatus(java.lang.String pid)
public java.lang.String roleForPlayer(int turnNumber)
public float getScore(java.lang.String metric)
public float getScore(java.lang.String metric, Layer l)
public float getRawScore(java.lang.String metric)
public float getRawScore(java.lang.String metric, Layer l)
public java.util.List getNewProposals()
public java.util.List getPlayedProposals()
public java.util.List getPassedProposals()
public java.util.List getFailedProposals()
public java.util.List getStatusProposals(java.lang.String status)
public java.util.List getCurrentProposals()
public java.util.List getInactiveProposals()
public java.util.Collection getActiveProposals()
public java.lang.String getTurnSummary()
public java.lang.String htmlScoreBars()
public java.lang.String htmlScoreBars(boolean all)
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |