com.threerings.miso.data
Class SparseMisoSceneModel.Section

java.lang.Object
  extended by com.threerings.io.SimpleStreamableObject
      extended by com.threerings.miso.data.SparseMisoSceneModel.Section
All Implemented Interfaces:
com.threerings.io.Streamable, Cloneable
Enclosing class:
SparseMisoSceneModel

public static class SparseMisoSceneModel.Section
extends com.threerings.io.SimpleStreamableObject
implements Cloneable

Contains information on a section of this scene. This is only public so that the scene model parser can do its job, so don't go poking around in here.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.threerings.io.Streamable
com.threerings.io.Streamable.Closure
 
Field Summary
 int[] baseTileIds
          The combined tile ids (tile set id and tile id) for our section (in row major order).
 ObjectInfo[] objectInfo
          Information records for the "interesting" objects in the object layer.
 int[] objectTileIds
          The combined tile ids (tile set id and tile id) of the "uninteresting" tiles in the object layer.
 short[] objectXs
          The x coordinate of the "uninteresting" tiles in the object layer.
 short[] objectYs
          The y coordinate of the "uninteresting" tiles in the object layer.
 int width
          The width of this section in tiles.
 short x
          The tile coordinate of our upper leftmost tile.
 short y
          The tile coordinate of our upper leftmost tile.
 
Constructor Summary
SparseMisoSceneModel.Section()
          Creates a blank section instance, suitable for unserialization or configuration by the XML scene parser.
SparseMisoSceneModel.Section(short x, short y, short width, short height)
          Creates a new scene section with the specified dimensions.
 
Method Summary
 boolean addObject(ObjectInfo info)
           
 SparseMisoSceneModel.Section clone()
           
 void getAllObjects(ArrayList<ObjectInfo> list)
           
 int getBaseTileId(int col, int row)
           
 void getObjects(Rectangle region, ObjectSet set)
           
protected  int indexOfUn(ObjectInfo info)
          Returns the index of the specified object in the uninteresting arrays or -1 if it is not in this section as an uninteresting object.
 boolean isBlank()
          Returns true if this section contains no data beyond the default.
 boolean removeObject(ObjectInfo info)
           
 void setBaseTile(int col, int row, int fqBaseTileId)
           
 String toString()
           
 
Methods inherited from class com.threerings.io.SimpleStreamableObject
toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

x

public short x
The tile coordinate of our upper leftmost tile.


y

public short y
The tile coordinate of our upper leftmost tile.


width

public int width
The width of this section in tiles.


baseTileIds

public int[] baseTileIds
The combined tile ids (tile set id and tile id) for our section (in row major order).


objectTileIds

public int[] objectTileIds
The combined tile ids (tile set id and tile id) of the "uninteresting" tiles in the object layer.


objectXs

public short[] objectXs
The x coordinate of the "uninteresting" tiles in the object layer.


objectYs

public short[] objectYs
The y coordinate of the "uninteresting" tiles in the object layer.


objectInfo

public ObjectInfo[] objectInfo
Information records for the "interesting" objects in the object layer.

Constructor Detail

SparseMisoSceneModel.Section

public SparseMisoSceneModel.Section()
Creates a blank section instance, suitable for unserialization or configuration by the XML scene parser.


SparseMisoSceneModel.Section

public SparseMisoSceneModel.Section(short x,
                                    short y,
                                    short width,
                                    short height)
Creates a new scene section with the specified dimensions.

Method Detail

getBaseTileId

public int getBaseTileId(int col,
                         int row)

setBaseTile

public void setBaseTile(int col,
                        int row,
                        int fqBaseTileId)

addObject

public boolean addObject(ObjectInfo info)

removeObject

public boolean removeObject(ObjectInfo info)

indexOfUn

protected int indexOfUn(ObjectInfo info)
Returns the index of the specified object in the uninteresting arrays or -1 if it is not in this section as an uninteresting object.


getAllObjects

public void getAllObjects(ArrayList<ObjectInfo> list)

getObjects

public void getObjects(Rectangle region,
                       ObjectSet set)

isBlank

public boolean isBlank()
Returns true if this section contains no data beyond the default. Used when saving a sparse scene: we omit blank sections.


clone

public SparseMisoSceneModel.Section clone()
Overrides:
clone in class Object

toString

public String toString()
Overrides:
toString in class com.threerings.io.SimpleStreamableObject