org.deken.game.map
Class MapSize

java.lang.Object
  extended by org.deken.game.map.MapSize

public class MapSize
extends java.lang.Object


Constructor Summary
MapSize()
          Defaults all values to one.
MapSize(int width, int height)
          Defaults the depth to one.
MapSize(int width, int height, int depth)
           
MapSize(int width, int height, int gridWidth, int gridHeight)
          Defaults the depth to zero and a grid depth of zero.
MapSize(int width, int height, int depth, int gridWidth, int gridHeight, int gridDepth)
           
 
Method Summary
 void ensureSize()
          Makes sure all the sizes are not zero.
 int getDepth()
          Number of layers in the map.
 int getFullDepth()
          Returns the full pixel depth of the map.
 int getFullHeight()
          Returns the full pixel height of the map.
 int getFullWidth()
          Returns the full pixel width of the map.
 int getGridDepth()
           
 int getGridHeight()
           
 int getGridWidth()
           
 int getHeight()
          Number of grids.
 GameLocation getPixelsFromTiles(GameLocation gameLocation)
          Creates a GameLocation that is in Pixels, from the tile size.
 GameLocation getTileLocationFromLocation(GameLocation location)
           
 int getWidth()
          Number of grids.
 int getXPixelFromTile(int tile)
          Returns the pixel location of the X Tile.
 int getXTileFromPixels(double pixels)
           
 int getXTileFromPixels(int pixels)
          Returns the X Tile at the pixel location.
 double getXTilePixelFromPixel(double pixels)
          Returns the pixel location of the tile of the value passed in.
 int getYPixelFromTile(int tile)
          Returns the pixel location of the Y Tile.
 int getYTileFromPixels(double pixels)
           
 int getYTileFromPixels(int pixels)
          Returns the Y Tile at the pixel location
 double getYTilePixelFromPixel(double pixels)
          Returns the pixel location of the tile of the value passed in.
 int getZPixelFromTile(int tile)
          Returns the pixel location of the Z Tile.
 int getZTileFromPixels(int pixels)
          Returns the Z Tile at the pixel location.
 boolean isXTileFromPixelsExact(double pixels)
           
 boolean isXTileFromPixelsExact(int pixels)
           
 boolean isYTileFromPixelsExact(double pixels)
           
 boolean isYTileFromPixelsExact(int pixels)
           
 void setDepth(int depth)
          Number of grids.
 void setGridDepth(int gridDepth)
           
 void setGridHeight(int gridHeight)
          Number of grids.
 void setGridWidth(int gridWidth)
           
 void setHeight(int height)
           
 void setWidth(int width)
          Number of grids.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MapSize

public MapSize()
Defaults all values to one.


MapSize

public MapSize(int width,
               int height)
Defaults the depth to one.

Parameters:
width - int Number of grids.
height - int Number of grids.

MapSize

public MapSize(int width,
               int height,
               int depth)
Parameters:
width - int Number of grids.
height - int Number of grids.
depth - int Number of grids.

MapSize

public MapSize(int width,
               int height,
               int gridWidth,
               int gridHeight)
Defaults the depth to zero and a grid depth of zero.

Parameters:
width - int Number of grids.
height - int Number of grids.
gridWidth - int Size of grid width.
gridHeight - int Size of grid height.

MapSize

public MapSize(int width,
               int height,
               int depth,
               int gridWidth,
               int gridHeight,
               int gridDepth)
Parameters:
width - int Number of grids.
height - int Number of grids.
depth - int Number of grids.
gridWidth - int Size of grid width.
gridHeight - int Size of grid height.
gridDepth - int Size of grid depth.
Method Detail

ensureSize

public void ensureSize()
Makes sure all the sizes are not zero.


getDepth

public int getDepth()
Number of layers in the map.

Returns:
int

getFullDepth

public int getFullDepth()
Returns the full pixel depth of the map.

Returns:
int

getFullHeight

public int getFullHeight()
Returns the full pixel height of the map.

Returns:
int

getFullWidth

public int getFullWidth()
Returns the full pixel width of the map.

Returns:
int

getGridDepth

public int getGridDepth()
Returns:
int

getGridHeight

public int getGridHeight()
Returns:
int

getGridWidth

public int getGridWidth()
Returns:
int

getHeight

public int getHeight()
Number of grids.

Returns:
int

getPixelsFromTiles

public GameLocation getPixelsFromTiles(GameLocation gameLocation)
Creates a GameLocation that is in Pixels, from the tile size.

Parameters:
gameLocation - GameLocation
Returns:
GameLocation

getWidth

public int getWidth()
Number of grids.

Returns:
int

getTileLocationFromLocation

public GameLocation getTileLocationFromLocation(GameLocation location)

getXTileFromPixels

public int getXTileFromPixels(int pixels)
Returns the X Tile at the pixel location.

Parameters:
pixels - int
Returns:
int X Tile

getXTileFromPixels

public int getXTileFromPixels(double pixels)

getXTilePixelFromPixel

public double getXTilePixelFromPixel(double pixels)
Returns the pixel location of the tile of the value passed in.

Parameters:
pixels -
Returns:
pixel

getXPixelFromTile

public int getXPixelFromTile(int tile)
Returns the pixel location of the X Tile.

Parameters:
tile - int
Returns:
int

getYTileFromPixels

public int getYTileFromPixels(int pixels)
Returns the Y Tile at the pixel location

Parameters:
pixels - int
Returns:
int Y Tile

getYTileFromPixels

public int getYTileFromPixels(double pixels)

getYTilePixelFromPixel

public double getYTilePixelFromPixel(double pixels)
Returns the pixel location of the tile of the value passed in.

Parameters:
pixels -
Returns:
pixel

getYPixelFromTile

public int getYPixelFromTile(int tile)
Returns the pixel location of the Y Tile.

Parameters:
tile - int
Returns:
int

getZTileFromPixels

public int getZTileFromPixels(int pixels)
Returns the Z Tile at the pixel location.

Parameters:
pixels - int
Returns:
int

getZPixelFromTile

public int getZPixelFromTile(int tile)
Returns the pixel location of the Z Tile.

Parameters:
tile - int
Returns:
int

isXTileFromPixelsExact

public boolean isXTileFromPixelsExact(int pixels)

isXTileFromPixelsExact

public boolean isXTileFromPixelsExact(double pixels)

isYTileFromPixelsExact

public boolean isYTileFromPixelsExact(int pixels)

isYTileFromPixelsExact

public boolean isYTileFromPixelsExact(double pixels)

setDepth

public void setDepth(int depth)
Number of grids.

Parameters:
depth - int

setGridDepth

public void setGridDepth(int gridDepth)
Parameters:
gridDepth - int

setGridHeight

public void setGridHeight(int gridHeight)
Number of grids.

Parameters:
gridHeight - int

setGridWidth

public void setGridWidth(int gridWidth)
Parameters:
gridWidth - int

setHeight

public void setHeight(int height)
Parameters:
height - int

setWidth

public void setWidth(int width)
Number of grids.

Parameters:
width - int

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object