public class SceneBlock extends Object
| Constructor and Description |
|---|
SceneBlock(MisoSceneModel model,
MisoSceneMetrics metrics,
TileManager tileMgr,
int tx,
int ty,
int width,
int height) |
SceneBlock(MisoScenePanel panel,
int tx,
int ty,
int width,
int height)
Creates a scene block belonging to panel in preparation for its later resolution.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addObject(ObjectInfo info)
Adds the supplied object to this block.
|
boolean |
canTraverse(Object traverser,
int tx,
int ty)
Returns true if the specified traverser can traverse the specified
tile (which is assumed to be in the bounds of this scene block).
|
void |
computeMemoryUsage(Map<Tile.Key,BaseTile> bases,
Set<BaseTile> fringes,
Map<Tile.Key,ObjectTile> objects,
long[] usage)
Computes the memory usage of the base and object tiles in this
scene block; registering counted tiles in the hash map so that
other blocks can be sure not to double count them.
|
boolean |
deleteObject(ObjectInfo info)
Removes the specified object from this block.
|
BaseTile |
getBaseTile(int tx,
int ty)
Returns the base tile at the specified coordinates or null if
there's no tile at said coordinates.
|
Rectangle |
getBounds()
Returns the bounds of this block, in tile coordinates.
|
Polygon |
getFootprint()
Returns the screen-coordinate polygon bounding the footprint of
this block.
|
BaseTile |
getFringeTile(int tx,
int ty)
Returns the fringe tile at the specified coordinates or null if
there's no tile at said coordinates.
|
Rectangle |
getObjectBounds()
Returns the bounds of the screen coordinate rectangle that contains
all pixels that are drawn on by all objects (but not base tiles) in
this block.
|
SceneObject[] |
getObjects()
Returns an array of all resolved scene objects in this block.
|
Rectangle |
getScreenBounds()
Returns the bounds of the screen coordinate rectangle that contains all pixels that are
drawn on by all tiles and objects in this block.
|
boolean |
isResolved()
Returns true if this block has been resolved, false if not.
|
boolean |
resolve()
This method is called by the
SceneBlockResolver on the
block resolution thread to allow us to load up our image data
without blocking the AWT thread. |
void |
setVisiBlock(boolean visi)
Makes a note that this block was considered to be visible at the
time it was created.
|
String |
toString() |
void |
updateBaseTile(int fqTileId,
int tx,
int ty)
Informs this scene block that the specified base tile has been
changed.
|
void |
updateFringe(int tx,
int ty)
Instructs this block to recompute its fringe at the specified
location.
|
public SceneBlock(MisoScenePanel panel, int tx, int ty, int width, int height)
public SceneBlock(MisoSceneModel model, MisoSceneMetrics metrics, TileManager tileMgr, int tx, int ty, int width, int height)
public void setVisiBlock(boolean visi)
public boolean resolve()
SceneBlockResolver on the
block resolution thread to allow us to load up our image data
without blocking the AWT thread.public boolean isResolved()
public Rectangle getBounds()
public Rectangle getScreenBounds()
public Rectangle getObjectBounds()
null if
the block has no objects.public Polygon getFootprint()
public SceneObject[] getObjects()
public BaseTile getBaseTile(int tx, int ty)
public BaseTile getFringeTile(int tx, int ty)
public void updateBaseTile(int fqTileId,
int tx,
int ty)
public void updateFringe(int tx,
int ty)
public boolean addObject(ObjectInfo info)
update(java.util.Map<java.lang.Integer, com.threerings.miso.client.SceneBlock>) will be
needed.public boolean deleteObject(ObjectInfo info)
update(java.util.Map<java.lang.Integer, com.threerings.miso.client.SceneBlock>) will be needed.public boolean canTraverse(Object traverser, int tx, int ty)
public void computeMemoryUsage(Map<Tile.Key,BaseTile> bases, Set<BaseTile> fringes, Map<Tile.Key,ObjectTile> objects, long[] usage)
Copyright © 2015. All rights reserved.