com.threerings.miso.data
Class VirtualMisoSceneModel
java.lang.Object
com.threerings.io.SimpleStreamableObject
com.threerings.miso.data.MisoSceneModel
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.
VirtualMisoSceneModel
public VirtualMisoSceneModel()
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.