|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgizmoball.gameworld.GameWorldState
public class GameWorldState
A GameWorldSate is an implemenation of the WorldState interface for the purposes of this game.
objectList
: list // list of all GameObjects in the world
ballList
: list // list of all Balls in the world
gizmoList
: list // list of all Gizmos in the world
triggerMap
: map // map from the gameobjects to their associated
// triggers in the world
players
: list // list of all players in this world
Constructor Summary | |
---|---|
GameWorldState()
Creates a new empty GameWorldState All the lists/map are initialized but nothing is added |
Method Summary | |
---|---|
void |
addGameObject(GameObject go)
Adds a game object "go" to this world state |
void |
addTrigger(GameObject go,
Trigger t)
Associates the Trigger t (which involves Gizmo secondGO) with the GameObject firstGO |
java.util.List<GameObject> |
getAllGameObjects()
Returns the game objects in this world state |
java.util.Map<GameObject,java.util.Map<GameObject,java.util.List<Trigger>>> |
getAllTriggerInfo()
|
java.util.List<Ball> |
getBalls()
Returns the balls in this world state |
java.util.List<Gizmo> |
getGizmos()
Returns the gizmos in this world state |
java.util.List<Player> |
getPlayers()
Returns the players in this world. |
java.util.List<Trigger> |
getTriggers(GameObject g)
Returns the triggers in this world state corresponding to g |
void |
removeGameObject(GameObject goToBeRemoved)
Removes the object from the game |
void |
update(GameObject oldObject,
GameObject newObject)
Replaces the old object with the new object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GameWorldState()
Method Detail |
---|
public void addGameObject(GameObject go)
addGameObject
in interface WorldState
public java.util.List<GameObject> getAllGameObjects()
getAllGameObjects
in interface WorldState
public java.util.List<Ball> getBalls()
getBalls
in interface WorldState
public java.util.List<Gizmo> getGizmos()
getGizmos
in interface WorldState
public java.util.List<Trigger> getTriggers(GameObject g)
getTriggers
in interface WorldState
public java.util.List<Player> getPlayers()
public void update(GameObject oldObject, GameObject newObject)
WorldState
update
in interface WorldState
public void removeGameObject(GameObject goToBeRemoved)
removeGameObject
in interface WorldState
public void addTrigger(GameObject go, Trigger t)
public java.util.Map<GameObject,java.util.Map<GameObject,java.util.List<Trigger>>> getAllTriggerInfo()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |