|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjme.world.World
World maintains the game world, by handling the locale and
list of entities. World takes care of updating all game
items and the locale.
| Constructor Summary | |
World()
Constructor builds a default World object that does not
contain a locale nor any entities. |
|
World(Locale locale)
Constructor builds a World object with an initial
Locale. |
|
World(Locale locale,
java.util.ArrayList entities)
Constructor builds a World object with an initial
Locale and entity list. |
|
| Method Summary | |
void |
addEntity(EntityInterface entity)
addEntity adds an entity to the entity list. |
int |
getNumRenderedEntities()
getNumRenderedEntities returns the number of entities that
were rendered this frame. |
int |
getTotalEntities()
getTotalEntities returns the total number of
entities within the world. |
void |
render()
render renders the entities in turn and then the locale. |
void |
setCamera(Camera camera)
setCamera sets the camera for the current world. |
void |
setEntityVisibility(boolean value)
|
void |
setLocale(Locale locale)
setLocale sets the locale of this world. |
void |
setWater(Water water)
setWater sets the water representation of the terrain. |
java.lang.String |
toString()
toString returns the string representation of this object
in the format:jme.world.World@11a64ed Locale: {LOCALE} Entities: {ENTITY} |
void |
update(float time)
update updates the locale and any Entities
that are within the entities list. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public World()
World object that does not
contain a locale nor any entities.
public World(Locale locale)
World object with an initial
Locale.
locale - the game locale.
MonkeyRuntimeException - if locale is null.
public World(Locale locale,
java.util.ArrayList entities)
World object with an initial
Locale and entity list.
locale - the game locale.entities - the list of game entities.
MonkeyRuntimeException - if either locale or entities are null.| Method Detail |
public void setLocale(Locale locale)
setLocale sets the locale of this world.
locale - the game locale.
MonkeyRuntimeException - if local is null.public void setWater(Water water)
setWater sets the water representation of the terrain. This
takes an Water subclass. The client is reponsible
for calling the water's render method during the terrain's render call.
public void setCamera(Camera camera)
setCamera sets the camera for the current world.
camera - the new camera.public void setEntityVisibility(boolean value)
public void addEntity(EntityInterface entity)
addEntity adds an entity to the entity list.
entity - the entity to add to the list.
MonkeyRuntimeException - if enitity is null.public int getTotalEntities()
getTotalEntities returns the total number of
entities within the world.
public int getNumRenderedEntities()
getNumRenderedEntities returns the number of entities that
were rendered this frame.
public void update(float time)
update updates the locale and any Entities
that are within the entities list.
public void render()
render renders the entities in turn and then the locale.
public java.lang.String toString()
toString returns the string representation of this object
in the format:
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||