|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.newdawn.asd.data.GameWorld
A ticker than updates the turns based on the amount of time that needs to pass based on the rendering engine. TODO: Decide how turn length matters.
| Constructor Summary | |
GameWorld(long seed,
int schedulingOffset)
Create a new game world based on an initial random seed |
|
| Method Summary | |
void |
activate(Actor actor,
int x,
int y)
Activate the tile specified on behalf of the actor |
Actor |
addActor(java.lang.String username,
Stats stats)
Add an actor into the game world for a given player |
void |
addCommand(GameCommand command)
Add a command to the scheduled list. |
void |
addListener(GameWorldListener listener)
Add a listener that will recieve notification of game world events. |
Actor |
getActorById(int id)
Get an actor that resides in the world somewhere based on its ID |
int |
getChecksum()
Get the checksum of the game world and every element in it at the current simualtion time |
Map |
getMap(Actor actor)
Get the map containing within this game world |
Map |
getMap(int index)
Get the map at the specified index |
double |
getNextRandom()
Get the next random number. |
Actor |
getOwnedActor(java.lang.String owner)
Get an actor owned by a specific named user |
ActorList |
getPlayerActors()
Get the list of actors representing players |
int |
getScheduledCommandCount()
Get the number of commands scheduled in the game world |
long |
getServerOffset()
Retrieve the amount of millseconds we are offset to the server expected time |
long |
getTime()
Get the current simulation time |
boolean |
isGamePaused()
Check if the game is currently paused |
void |
removeActor(java.lang.String username)
Remove an actor for a given player from the game world |
void |
removeListener(GameWorldListener listener)
Remove a listener from the game world. |
void |
setGamePaused(boolean gamePaused)
Indicate whether the game should be paused or not |
void |
update(int delta)
Update the game world based on a given amount of real time passing. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public GameWorld(long seed,
int schedulingOffset)
seed - The random seed used to spawn the game worldschedulingOffset - The offset from sim time game commands are
expected to be scheduled at| Method Detail |
public void addCommand(GameCommand command)
command - The command to addpublic void setGamePaused(boolean gamePaused)
gamePaused - True if the game should be pausedpublic boolean isGamePaused()
public void update(int delta)
delta - The amount of read time that has passed since last
update (in milliseconds).public Map getMap(Actor actor)
actor - The actor whose map we're looking for
public Map getMap(int index)
index - The index of the map to retrieve
public double getNextRandom()
public void addListener(GameWorldListener listener)
listener - The listener to addpublic void removeListener(GameWorldListener listener)
listener - The listener that should be removedpublic void removeActor(java.lang.String username)
username - The name of the user that owns the actor to be
removed
public Actor addActor(java.lang.String username,
Stats stats)
username - The username of the player for which the actor is
being added.stats - The stats describing the actor being added
public Actor getOwnedActor(java.lang.String owner)
owner - The name of the owner whose actor should be retrieved
public long getTime()
public int getChecksum()
public long getServerOffset()
public int getScheduledCommandCount()
public ActorList getPlayerActors()
public Actor getActorById(int id)
id - The ID of the actor to be retrieved
public void activate(Actor actor,
int x,
int y)
actor - The actor performing the activationx - The x location of the tile to be activatedy - The y location of the tile to be activated
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||