|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.flexgen.map.MapTileType
public class MapTileType
Class representing types of map tiles that can be used in maps. Each map tile type contains a two-dimensional array of map units that define the map tile type and an array of map tile edges that define the four edges of the map tile.
Constructor Summary | |
---|---|
MapTileType(java.lang.String name,
int weight,
MapUnit[][] mapUnits,
MapTileEdge[] mapTileEdges,
MapTileOrientation[] distinctMapTileOrientations)
Construct a map tile type. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
Determines whether or not this map tile type is equal to another map tile type. |
MapTileOrientation[] |
getDistinctMapTileOrientations()
Get the array of map tile orientations that specify the distinct orientations that are possible for this map tile type. |
MapTileEdge |
getMapTileEdge(MapTileEdgePosition mapTileEdgePosition)
Get the map tile edge at the specified position in this map tile type. |
MapUnit |
getMapUnit(int x,
int y)
Get the map unit at the specified coordinates in this map tile type. |
int |
getSize()
Get the size of the map unit array that defines this map tile type. |
int |
getWeight()
Get the weight value used to determine the probability of selecting this tile type when generating a map. |
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 |
---|
public MapTileType(java.lang.String name, int weight, MapUnit[][] mapUnits, MapTileEdge[] mapTileEdges, MapTileOrientation[] distinctMapTileOrientations)
name
- Name of the map tile type. Cannot be null.weight
- The weight value used to determine the probability of selecting this tile type
when generating a map. Larger values make this tile type more likely to be
selected. The probability of selecting this tile type is computed by taking the
weight of this tile type and dividing it by the sum of the weight values for all
of the tile types. Cannot be negative.mapUnits
- Two-dimensional array of map units that define the map tile type. Cannot be null.
Must contain at least one row. Each row must contain the same number of elements.
Must contain the same number of columns as it does rows. No element can be null.mapTileEdges
- Array of map tile edges that define the four edges of this map tile type. Cannot
be null. Must contain four elements. No element can be null. The first element is
the top edge of the tile. The second element is the right edge of the tile. The
third element is the bottom edge of the tile. The fourth element is the left edge
of the tile.distinctMapTileOrientations
- Array of map tile orientations that specify the distinct orientations that are
possible for this map tile type. Cannot be null. Must contain at lease one
element. No element can be null. Cannot contain two or more elements that are
identical.Method Detail |
---|
public int getWeight()
public int getSize()
public MapUnit getMapUnit(int x, int y)
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 this map tile type.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 this map tile type.
public MapTileEdge getMapTileEdge(MapTileEdgePosition mapTileEdgePosition)
mapTileEdgePosition
- Position of the map tile edge to get.
public MapTileOrientation[] getDistinctMapTileOrientations()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- The map tile type against which to compare this map tile type.
public int hashCode()
hashCode
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2009 - Jeffrey J. Weston <jjweston@gmail.com>
All rights reserved. Use is subject to license terms.