|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdip.world.World
The entire game World. This contains the state of an entire game.
A World contains:
Nested Class Summary | |
static class |
World.VariantInfo
Variant Info is a class which holds information about the variant, map, symbols, and symbol options. |
Constructor Summary | |
protected |
World(Map map)
Constructs a World object. |
Method Summary | |
java.util.List |
getAllTurnStates()
Get all TurnStates. |
GameMetadata |
getGameMetadata()
Gets the Game metadata. |
GameSetup |
getGameSetup()
Returns the GameSetup object |
java.lang.Object |
getGlobalState()
Get the Global state object. |
TurnState |
getInitialTurnState()
Gets the first TurnState object |
TurnState |
getLastTurnState()
Gets the most current (last in the list) TurnState. |
Map |
getMap()
Returns the Map (dip.world.Map) associated with this World. |
TurnState |
getNextTurnState(TurnState state)
Gets the TurnState that comes after this phase (if it exists). |
java.util.Set |
getPhaseSet()
returns sorted (ascending) set of all Phases |
PlayerMetadata |
getPlayerMetadata(Power power)
Gets the metadata for a power. |
java.lang.Object |
getPowerState(Power power)
Gets any special per-power state information that is not associated with a particular TurnState. |
PressStore |
getPressStore()
Get the PressStore object, which stores and retreives Press messages. |
TurnState |
getPreviousTurnState(TurnState state)
Gets the TurnState that comes before the specified phase. |
RuleOptions |
getRuleOptions()
Convenience method: gets RuleOptions from VariantInfo object. |
TurnState |
getTurnState(Phase phase)
Gets the TurnState associated with the specified Phase |
UndoRedoManager |
getUndoRedoManager()
Gets the UndoRedo manager that was saved. |
World.VariantInfo |
getVariantInfo()
Get the Variant Info object. |
VictoryConditions |
getVictoryConditions()
Get the Victory Conditions |
static World |
open(java.io.File file)
Reads a World object from a file. |
void |
removeAllTurnStates()
Removes all TurnStates from the World. |
void |
removeTurnState(TurnState turnState)
Removes a turnstate from the world. |
static void |
save(java.io.File file,
World world)
Saves a World object to a file. |
void |
setGameMetadata(GameMetadata gmd)
Sets the Game metadata |
void |
setGameSetup(GameSetup gs)
Sets the GameSetup object |
void |
setGlobalState(java.lang.Object state)
Set the Global state object. |
void |
setPlayerMetadata(Power power,
PlayerMetadata pmd)
Sets the metadata for a player, referenced by Power |
void |
setPowerState(Power power,
java.lang.Object state)
Sets any special per-power state information that is not associated with a particular TurnState. |
void |
setRuleOptions(RuleOptions ruleOpts)
Convenience method: sets RuleOptions in VariantInfo object. |
void |
setTurnState(TurnState turnState)
If a TurnState with the given phase already exists, it is replaced. |
void |
setUndoRedoManager(UndoRedoManager urm)
Sets the UndoRedo manager to be saved. |
void |
setVariantInfo(World.VariantInfo vi)
Set the Variant Info object. |
void |
setVictoryConditions(VictoryConditions value)
Set the Victory Conditions |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected World(Map map)
Method Detail |
public static World open(java.io.File file) throws java.io.IOException
java.io.IOException
public static void save(java.io.File file, World world) throws java.io.IOException
java.io.IOException
public Map getMap()
public void setPowerState(Power power, java.lang.Object state)
public java.lang.Object getPowerState(Power power)
public void setGlobalState(java.lang.Object state)
public java.lang.Object getGlobalState()
public void setVictoryConditions(VictoryConditions value)
public VictoryConditions getVictoryConditions()
public TurnState getInitialTurnState()
public TurnState getLastTurnState()
public TurnState getTurnState(Phase phase)
public TurnState getNextTurnState(TurnState state)
Note that the next phase may not be (due to phase skipping) the same phase generated by phase.getNext(). This will return null iff we are at the last Phase.
public java.util.List getAllTurnStates()
public TurnState getPreviousTurnState(TurnState state)
Note that the previous phase may not be (due to phase skipping) the same phase generated by phase.getPrevious(). This will return null iff we are at the first (initial) Phase.
public void setTurnState(TurnState turnState)
public void removeTurnState(TurnState turnState)
public void removeAllTurnStates()
public java.util.Set getPhaseSet()
public void setGameMetadata(GameMetadata gmd)
public GameMetadata getGameMetadata()
public void setPlayerMetadata(Power power, PlayerMetadata pmd)
public PlayerMetadata getPlayerMetadata(Power power)
public void setUndoRedoManager(UndoRedoManager urm)
public UndoRedoManager getUndoRedoManager()
public void setGameSetup(GameSetup gs)
public GameSetup getGameSetup()
public PressStore getPressStore()
public World.VariantInfo getVariantInfo()
public void setVariantInfo(World.VariantInfo vi)
public RuleOptions getRuleOptions()
public void setRuleOptions(RuleOptions ruleOpts)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |