1 package tim.prune.threedee;
4 * Holds the definition of the terrain to use
5 * (whether or not to use a terrain, and the resolution)
7 public class TerrainDefinition
9 private boolean _useTerrain = false;
10 private int _gridSize = 0;
13 * Empty constructor specifying no terrain
15 public TerrainDefinition()
22 * @param inUse true to use a terrain
23 * @param inGridSize size of grid
25 public TerrainDefinition(boolean inUse, int inGridSize)
27 setUseTerrain(inUse, inGridSize);
32 * @param inUse true to use a terrain
33 * @param inGridSize size of grid
35 public void setUseTerrain(boolean inUse, int inGridSize)
38 _gridSize = inGridSize;
42 * @return true if terrain should be used, false otherwise
44 public boolean getUseTerrain() {
45 return _useTerrain && _gridSize > 2;
51 public int getGridSize() {
57 * Compare two TerrainDefinitions to see if they're equal
59 public boolean equals(Object obj)
61 if (obj == null || !(obj instanceof TerrainDefinition)) {
64 TerrainDefinition other = (TerrainDefinition) obj;
65 return _useTerrain == other._useTerrain
66 && _gridSize == other._gridSize;