X-Git-Url: http://gitweb.fperrin.net/?a=blobdiff_plain;f=tim%2Fprune%2Fthreedee%2FTerrainDefinition.java;fp=tim%2Fprune%2Fthreedee%2FTerrainDefinition.java;h=0b35670aaa61d55042b1e20e20dac200fdf481d0;hb=326f489e36aa7f235bc19409a57bf4955cd50f24;hp=0000000000000000000000000000000000000000;hpb=8c8868ae29b3252f02e094c02307384cf61ba667;p=GpsPrune.git diff --git a/tim/prune/threedee/TerrainDefinition.java b/tim/prune/threedee/TerrainDefinition.java new file mode 100644 index 0000000..0b35670 --- /dev/null +++ b/tim/prune/threedee/TerrainDefinition.java @@ -0,0 +1,54 @@ +package tim.prune.threedee; + +/** + * Holds the definition of the terrain to use + * (whether or not to use a terrain, and the resolution) + */ +public class TerrainDefinition +{ + private boolean _useTerrain = false; + private int _gridSize = 0; + + /** + * Empty constructor specifying no terrain + */ + public TerrainDefinition() + { + this(false, 0); + } + + /** + * Constructor + * @param inUse true to use a terrain + * @param inGridSize size of grid + */ + public TerrainDefinition(boolean inUse, int inGridSize) + { + setUseTerrain(inUse, inGridSize); + } + + /** + * Set the parameters + * @param inUse true to use a terrain + * @param inGridSize size of grid + */ + public void setUseTerrain(boolean inUse, int inGridSize) + { + _useTerrain = inUse; + _gridSize = inGridSize; + } + + /** + * @return true if terrain should be used, false otherwise + */ + public boolean getUseTerrain() { + return _useTerrain && _gridSize > 2; + } + + /** + * @return grid size + */ + public int getGridSize() { + return _gridSize; + } +}