com.threerings.miso.data
Class VirtualMisoSceneModel

java.lang.Object
  extended by com.threerings.io.SimpleStreamableObject
      extended by com.threerings.miso.data.MisoSceneModel
          extended by com.threerings.miso.data.VirtualMisoSceneModel
All Implemented Interfaces:
com.threerings.io.Streamable, Cloneable

public abstract class VirtualMisoSceneModel
extends MisoSceneModel

A convenient base class for "virtual" scenes which do not allow editing and compute the base and object tiles rather than obtain them from some data structure.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.threerings.io.Streamable
com.threerings.io.Streamable.Closure
 
Constructor Summary
VirtualMisoSceneModel()
           
 
Method Summary
 boolean addObject(ObjectInfo info)
          Adds an object to this scene.
 boolean removeObject(ObjectInfo info)
          Removes the specified object from the scene.
 boolean setBaseTile(int fqTileId, int x, int y)
          Updates the tile at the specified location in the base layer.
 void updateObject(ObjectInfo info)
          Updates an object in this scene.
 
Methods inherited from class com.threerings.miso.data.MisoSceneModel
clone, getBaseTileId, getDefaultBaseTileSet, getObjects, setDefaultBaseTileSet
 
Methods inherited from class com.threerings.io.SimpleStreamableObject
toString, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VirtualMisoSceneModel

public VirtualMisoSceneModel()
Method Detail

setBaseTile

public boolean setBaseTile(int fqTileId,
                           int x,
                           int y)
Description copied from class: MisoSceneModel
Updates the tile at the specified location in the base layer.

Note that if there are fringe tiles associated with this scene, calling this method may result in the surrounding fringe tiles being cleared and subsequently recalculated. This should not be called on a displaying scene unless you know what you are doing.

Specified by:
setBaseTile in class MisoSceneModel
Parameters:
fqTileId - the fully-qualified tile id (@see TileUtil#getFQTileId}) of the tile to set.
x - the x-coordinate of the tile to set.
y - the y-coordinate of the tile to set.
Returns:
false if the specified tile coordinates are outside of the scene and the tile was not saved, true otherwise.

addObject

public boolean addObject(ObjectInfo info)
Description copied from class: MisoSceneModel
Adds an object to this scene.

Specified by:
addObject in class MisoSceneModel
Returns:
true if the object was added, false if the add was rejected due to being a duplicate.

updateObject

public void updateObject(ObjectInfo info)
Description copied from class: MisoSceneModel
Updates an object in this scene.

Specified by:
updateObject in class MisoSceneModel

removeObject

public boolean removeObject(ObjectInfo info)
Description copied from class: MisoSceneModel
Removes the specified object from the scene.

Specified by:
removeObject in class MisoSceneModel
Returns:
true if it was removed, false if the object was not in the scene.