mdh.hephaestus2
Class Grid

java.lang.Object
  |
  +--mdh.hephaestus2.Grid
All Implemented Interfaces:
Serializable

public final class Grid
extends Object
implements Serializable

A single map square.

Author:
Copyright © 2001 by Mark Hughes <kamikaze@kuoi.asui.uidaho.edu>
See Also:
Serialized Form

Method Summary
 void clear()
          Destroys everything in the grid.
 Thing findBlocking()
          Returns the first blocking Thing, or null if none of the contents are blocking.
 Terrain findTerrain()
          Returns the Terrain object assigned to this Grid, or null if none.
 int getNContents()
          Returns the number of contents.
 int getOpacity()
          Returns the opacity level determined by the terrain and contents, one of Global.OPA_*.
 int getTerrain()
          Returns the ID of the terrain type.
 ArrayList listContents()
          Returns a ArrayList of the content Things.
 void setTerrain(int t)
          Sets the terrain type of this Grid.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

clear

public void clear()
           throws HephaestusException
Destroys everything in the grid.

HephaestusException

findBlocking

public final Thing findBlocking()
                         throws HephaestusException
Returns the first blocking Thing, or null if none of the contents are blocking.

HephaestusException

findTerrain

public final Terrain findTerrain()
                          throws HephaestusException
Returns the Terrain object assigned to this Grid, or null if none.

HephaestusException

getNContents

public final int getNContents()
                       throws HephaestusException
Returns the number of contents.

HephaestusException

getOpacity

public final int getOpacity()
                     throws HephaestusException
Returns the opacity level determined by the terrain and contents, one of Global.OPA_*.

HephaestusException

getTerrain

public final int getTerrain()
                     throws HephaestusException
Returns the ID of the terrain type.

HephaestusException

listContents

public ArrayList listContents()
                       throws HephaestusException
Returns a ArrayList of the content Things.

HephaestusException

setTerrain

public void setTerrain(int t)
                throws HephaestusException
Sets the terrain type of this Grid.

HephaestusException

toString

public String toString()
Overrides:
toString in class Object