|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.io.SimpleStreamableObject
com.threerings.whirled.data.SceneModel
com.threerings.tudey.data.TudeySceneModel
public class TudeySceneModel
Contains a representation of a Tudey scene.
| Nested Class Summary | |
|---|---|
static class |
TudeySceneModel.AreaEntry
An area entry. |
static class |
TudeySceneModel.Entry
An entry in the scene. |
static class |
TudeySceneModel.GlobalEntry
A global entry. |
static class |
TudeySceneModel.IdEntry
An entry identified by an integer id. |
static interface |
TudeySceneModel.LayerObserver
An extended Observer interface for observers interested in layers. |
static interface |
TudeySceneModel.Observer
An interface for objects interested in changes to the scene model. |
static class |
TudeySceneModel.Paint
Contains information on a painted location. |
static class |
TudeySceneModel.PathEntry
A path entry. |
static class |
TudeySceneModel.PlaceableEntry
A placeable entry. |
static class |
TudeySceneModel.TileEntry
A tile entry. |
static class |
TudeySceneModel.Vertex
Represents a single vertex in a path or area. |
| Nested classes/interfaces inherited from interface com.threerings.io.Streamable |
|---|
com.threerings.io.Streamable.Closure |
| Field Summary |
|---|
| Fields inherited from class com.threerings.whirled.data.SceneModel |
|---|
auxModels, name, sceneId, version |
| Constructor Summary | |
|---|---|
TudeySceneModel()
Creates a new, empty scene model. |
|
| Method Summary | |
|---|---|
boolean |
addEntry(TudeySceneModel.Entry entry)
Adds an entry to the scene, assigning it a unique id in the process if it is an TudeySceneModel.IdEntry. |
boolean |
addEntry(TudeySceneModel.Entry entry,
boolean assignId)
Adds an entry to the scene. |
int |
addLayer(String n)
Deprecated. |
int |
addLayer(String name,
int position)
Add a new layer to the model. |
void |
addObserver(TudeySceneModel.Observer observer)
Adds an observer for scene changes. |
void |
clearPaint()
Clears all paint from the scene. |
TudeySceneModel |
clone()
|
boolean |
collides(Actor actor,
Shape shape)
Checks the specified actor for a collision with the environment. |
boolean |
collides(int mask,
Shape shape)
Checks the specified mask for a collision with the environment. |
boolean |
containsEntry(Object key)
Determines whether the scene contains an entry with the supplied key. |
CoordIntMap |
getCollisionFlags()
Returns a reference to the map containing the tile collision flags. |
ConfigManager |
getConfigManager()
Returns a reference to the scene's configuration manager. |
byte[] |
getData()
Returns the cached exported binary representation of the model. |
Map<Object,SpaceElement> |
getElements()
Returns a reference to the map from entry key to space elements. |
Collection<TudeySceneModel.Entry> |
getEntries()
Returns a reference to the collection of entries. |
void |
getEntries(Shape shape,
Collection<TudeySceneModel.Entry> results)
Retrieves all entries intersecting the supplied shape. |
void |
getEntries(Shape shape,
Predicate<? super TudeySceneModel.Entry> pred,
Collection<TudeySceneModel.Entry> results)
Retrieves all entries intersecting the supplied shape and matching the predicate. |
TudeySceneModel.Entry |
getEntry(Object key)
Looks up the entry with the supplied key. |
int |
getLayer(Object key)
Get the layer of the entry with the specified key. |
List<String> |
getLayers()
Get the layer names. |
String |
getNotes()
Returns the scene notes. |
TudeySceneModel.Paint |
getPaint(int x,
int y)
Returns the paint at the specified coordinates, if any. |
boolean |
getPenetration(Actor actor,
Shape shape,
Vector2f result)
Checks whether the actor is colliding with anything and, if it is, populates the provided object with the penetration vector (the minimum translation required to cancel the penetration). |
TudeySceneConfig |
getPlaceConfig()
Returns a reference to the model's place config. |
void |
getPreloads(PreloadableSet preloads)
Adds the resources to preload for this scene model to the supplied set. |
void |
getResources(Set<String> paths)
Adds the resources referenced by this scene model to the supplied set. |
TudeySceneModel |
getSceneModel()
Returns a reference to the scene model. |
Space |
getSpace()
Returns a reference to the space containing the (non-tile) entry elements. |
List<TudeySceneModel.Entry> |
getTaggedEntries(String tag)
Returns the list of all entries bearing the specified tag, or null for none. |
TudeySceneModel.Entry |
getTaggedEntry(String tag)
Returns the first entry bearing the specified tag, or null for none. |
int |
getTileElevation(int x,
int y)
Returns the tile elevation at the specified coordinates, or Integer.MIN_VALUE if
there is no tile there. |
void |
getTileEntries(Rectangle region,
Collection<TudeySceneModel.TileEntry> results)
Retrieves all of the tile entries intersecting the supplied region. |
TudeySceneModel.TileEntry |
getTileEntry(int x,
int y)
Returns the tile entry intersecting the specified coordinates, if any. |
void |
init(ConfigManager cfgmgr)
Initializes the model. |
void |
invalidate()
Invalidates any cached data in the model, forcing it to be recreated (and sets the dirty flag). |
boolean |
isDirty()
Returns the value of the dirty flag. |
boolean |
isLayerEmpty(int layer)
Return true if the specified layer not 0 and is empty. |
void |
readFields(Importer in)
Custom field read method. |
void |
readObject(com.threerings.io.ObjectInputStream in)
Custom read method for streaming. |
TudeySceneModel.Entry |
removeEntry(Object key)
Removes an entry from the scene. |
void |
removeLayer(int layer)
Remove the specified layer, moving anything present to the base layer. |
void |
removeObserver(TudeySceneModel.Observer observer)
Removes a scene observer. |
void |
renameLayer(int layer,
String name)
Rename one of the layers. |
void |
setDirty(boolean dirty)
Sets the value of the dirty flag. |
void |
setLayer(Object key,
int layer)
Set the layer of the entry with the specified key. |
void |
setName(String name)
Sets the scene's name and invalidates. |
void |
setNotes(String notes)
Sets the scene notes. |
TudeySceneModel.Paint |
setPaint(int x,
int y,
TudeySceneModel.Paint paint)
Sets the paint at the specified coordinates. |
void |
setPlaceConfig(TudeySceneConfig config)
Sets the place config for the model. |
TudeySceneModel.Entry |
updateEntry(TudeySceneModel.Entry nentry)
Updates an entry within the scene. |
boolean |
validateReferences(String where,
PrintStream out)
Validates the references in the scene. |
void |
writeFields(Exporter out)
Custom field write method. |
void |
writeObject(com.threerings.io.ObjectOutputStream out)
Custom write method for streaming. |
| Methods inherited from class com.threerings.whirled.data.SceneModel |
|---|
addAuxModel, blankSceneModel |
| Methods inherited from class com.threerings.io.SimpleStreamableObject |
|---|
toString |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TudeySceneModel()
| Method Detail |
|---|
public void init(ConfigManager cfgmgr)
public ConfigManager getConfigManager()
public void addObserver(TudeySceneModel.Observer observer)
public void removeObserver(TudeySceneModel.Observer observer)
public void setName(String name)
public void setNotes(String notes)
public String getNotes()
public void setPlaceConfig(TudeySceneConfig config)
public TudeySceneConfig getPlaceConfig()
public CoordIntMap getCollisionFlags()
public Space getSpace()
public Map<Object,SpaceElement> getElements()
public boolean addEntry(TudeySceneModel.Entry entry)
TudeySceneModel.IdEntry.
public boolean addEntry(TudeySceneModel.Entry entry,
boolean assignId)
assignId - if true and the entry is an TudeySceneModel.IdEntry, assign a unique id to
the entry.
public TudeySceneModel.Entry updateEntry(TudeySceneModel.Entry nentry)
null for none (in which
case a warning will be logged).public TudeySceneModel.Entry removeEntry(Object key)
null for none (in which
case a warning will be logged).public boolean containsEntry(Object key)
public TudeySceneModel.Entry getEntry(Object key)
null if not found.public TudeySceneModel.Entry getTaggedEntry(String tag)
null for none.
public List<TudeySceneModel.Entry> getTaggedEntries(String tag)
null for none.
public Collection<TudeySceneModel.Entry> getEntries()
public void getEntries(Shape shape,
Collection<TudeySceneModel.Entry> results)
public void getEntries(Shape shape,
Predicate<? super TudeySceneModel.Entry> pred,
Collection<TudeySceneModel.Entry> results)
public void getTileEntries(Rectangle region,
Collection<TudeySceneModel.TileEntry> results)
public TudeySceneModel.TileEntry getTileEntry(int x,
int y)
public int getTileElevation(int x,
int y)
Integer.MIN_VALUE if
there is no tile there.
public int addLayer(String name,
int position)
@Deprecated public int addLayer(String n)
public void renameLayer(int layer,
String name)
public List<String> getLayers()
public boolean isLayerEmpty(int layer)
public void removeLayer(int layer)
public int getLayer(Object key)
public void setLayer(Object key,
int layer)
public TudeySceneModel.Paint setPaint(int x,
int y,
TudeySceneModel.Paint paint)
public TudeySceneModel.Paint getPaint(int x,
int y)
public void clearPaint()
public void getPreloads(PreloadableSet preloads)
public void getResources(Set<String> paths)
public boolean validateReferences(String where,
PrintStream out)
public void writeFields(Exporter out)
throws IOException
IOException
public void readFields(Importer in)
throws IOException
IOException
public void writeObject(com.threerings.io.ObjectOutputStream out)
throws IOException
IOException
public void readObject(com.threerings.io.ObjectInputStream in)
throws IOException
IOExceptionpublic byte[] getData()
public void invalidate()
public void setDirty(boolean dirty)
public boolean isDirty()
public boolean collides(Actor actor,
Shape shape)
collides in interface ActorAdvancer.Environment
public boolean collides(int mask,
Shape shape)
public TudeySceneModel getSceneModel()
ActorAdvancer.Environment
getSceneModel in interface ActorAdvancer.Environment
public boolean getPenetration(Actor actor,
Shape shape,
Vector2f result)
ActorAdvancer.Environment
getPenetration in interface ActorAdvancer.Environmentpublic TudeySceneModel clone()
clone in class com.threerings.whirled.data.SceneModel
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||