de.mud.bsx
Class BSXScene

java.lang.Object
  |
  +--de.mud.bsx.BSXObject
        |
        +--de.mud.bsx.BSXScene

public class BSXScene
extends BSXObject

Scene object for BSX Scenes.

Version:
1.1
Author:
Thomas Kriegelstein (tk4@rb.mud.de)

Field Summary
protected  java.util.Vector[] layers
          the eight BSX depth layers
protected  java.util.Vector[] positions
          positions of the contained objects
 
Fields inherited from class de.mud.bsx.BSXObject
bsxColors, data, poly
 
Constructor Summary
BSXScene(java.lang.String id, int[][] data)
          Constructor for BSXScene
 
Method Summary
 void addObject(java.lang.String id, int x, int y)
          adds an object to this scene
 void clean()
          removes all objects from all layers
 boolean containsObject(java.lang.String id)
          checks if specified object is within this scene
 void fill(java.awt.Graphics g)
          draws the scene on a graphics object
 int layerOfObject(java.lang.String id)
          query the layer of the specified object
 java.awt.Point locateObject(java.lang.String id)
          querys the location of an object
 java.util.Enumeration objects(int layer)
          querys objects on a specific layer in this scene
 void removeObject(java.lang.String id)
          removes the specified object from the scene
 void removeObject(java.lang.String id, int layer)
          removes the specified object from the scene
 
Methods inherited from class de.mud.bsx.BSXObject
draw, equals, flush, hashCode, setData
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

layers

protected final java.util.Vector[] layers
the eight BSX depth layers

positions

protected final java.util.Vector[] positions
positions of the contained objects
Constructor Detail

BSXScene

public BSXScene(java.lang.String id,
                int[][] data)
Constructor for BSXScene
Parameters:
id - Identifier of this scene
img - offscreenimage to render the data on
data - description of this scene
Method Detail

containsObject

public boolean containsObject(java.lang.String id)
checks if specified object is within this scene
Parameters:
id - object to be checked
Returns:
true if object is here, otherwise false

addObject

public void addObject(java.lang.String id,
                      int x,
                      int y)
adds an object to this scene
Parameters:
id - object to be added
x - x-position of object in scene
y - y-position of object in scene

layerOfObject

public int layerOfObject(java.lang.String id)
query the layer of the specified object
Parameters:
id - object in this scene
Returns:
-1 object not in this scene, 0..7 layer of the object

removeObject

public void removeObject(java.lang.String id,
                         int layer)
removes the specified object from the scene
Parameters:
id - object to be removed
layer - number of the layer the object is supposed to be

removeObject

public void removeObject(java.lang.String id)
removes the specified object from the scene
Parameters:
id - object to be removed

locateObject

public java.awt.Point locateObject(java.lang.String id)
querys the location of an object
Parameters:
id - object to be found
Returns:
null object is not in this scene, location otherwise

clean

public void clean()
removes all objects from all layers

objects

public java.util.Enumeration objects(int layer)
querys objects on a specific layer in this scene
Parameters:
layer - layer to look on
Returns:
Enumeration with objects on that layer

fill

public void fill(java.awt.Graphics g)
draws the scene on a graphics object
Parameters:
g - graphics object to draw on
io - ImageObserver to be notified