org.flexgen.map
Class MapTile

java.lang.Object
  extended by org.flexgen.map.MapTile

public class MapTile
extends java.lang.Object

Class representing a map tile. Contains the type and orientation for the map tile.


Constructor Summary
MapTile(MapTileType mapTileType, MapTileOrientation mapTileOrientation)
          Construct a map tile.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Determines whether or not this map tile is equal to another map tile.
 MapTileEdge getMapTileEdge(MapTileEdgePosition mapTileEdgePosition)
          Get the map tile edge at the specified position in this map tile.
 MapUnit getMapUnit(int x, int y)
          Get the map unit at the specified coordinates in this map tile.
 int hashCode()
          Returns a hash code value for the object.
 java.lang.String toString()
          Get the string representation of this object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MapTile

public MapTile(MapTileType mapTileType,
               MapTileOrientation mapTileOrientation)
Construct a map tile.

Parameters:
mapTileType - Type of the map tile. Cannot be null.
mapTileOrientation - Orientation of the map tile. Cannot be null.
Method Detail

getMapUnit

public MapUnit getMapUnit(int x,
                          int y)
Get the map unit at the specified coordinates in this map tile.

Parameters:
x - X coordinate of the map unit to get. Must be greater than or equal to 0. Must be less than the size of the array of map units defining the map tile type for this map tile.
y - Y coordinate of the map unit to get. Must be greater than or equal to 0. Must be less than the size of the array of map units defining the map tile type for this map tile.
Returns:
The map unit at the specified coordinates in this map tile.

getMapTileEdge

public MapTileEdge getMapTileEdge(MapTileEdgePosition mapTileEdgePosition)
Get the map tile edge at the specified position in this map tile.

Parameters:
mapTileEdgePosition - Position of the map tile edge to get.
Returns:
The map unit at the specified coordinates in this map tile.

toString

public java.lang.String toString()
Get the string representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
The string representation of this object.

equals

public boolean equals(java.lang.Object obj)
Determines whether or not this map tile is equal to another map tile.

Overrides:
equals in class java.lang.Object
Parameters:
obj - The map tile against which to compare this map tile.
Returns:
True if the two map tiles are equal, false otherwise.

hashCode

public int hashCode()
Returns a hash code value for the object.

Overrides:
hashCode in class java.lang.Object
Returns:
A hash code value for this object.


FlexGen Home

Get FlexGen at SourceForge.net. Fast, secure and Free Open Source software downloads

Copyright © 2009 - Jeffrey J. Weston <jjweston@gmail.com>

All rights reserved. Use is subject to license terms.