netwar.game
Class HexType

java.lang.Object
  |
  +--netwar.game.HexType

public class HexType
extends java.lang.Object

The HexType class contains every bit of information that is needed to describe a whole set of similar tiles. This structure does not contain specific information such as whether or not a unit is present. (etc.) It does, however, hold methods and fields related to all similar tiles. As an example, a single HexType could describe all the trees in a given map; this one class would take care of drawing all of the tree tiles as well as making them all impassable.

Author:
Kyle Kakligian

Field Summary
static Point2D[] Resolutions
          Contains the common dimensions of all the tiles.
 
Constructor Summary
HexType(java.lang.String fileName)
          Creates a new instance of HexType
HexType(java.lang.String fileName, java.awt.Color worldMapColor)
          Creates a new instance of HexType
HexType(java.lang.String fileName, java.awt.Color worldMapColor, boolean Passable)
          Creates a new instance of HexType
 
Method Summary
 void draw(GameViewer v, Point3D pt)
          Draws the HexType onto the backgound layer.
 java.awt.Color getColor()
          Gets the color for the world map.
 int getDefaultStatus()
          Returns default status for Hex with this HexType.
 boolean getPassable()
          Gets whether or not the tile is passable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Resolutions

public static Point2D[] Resolutions
Contains the common dimensions of all the tiles.
Constructor Detail

HexType

public HexType(java.lang.String fileName)
Creates a new instance of HexType
Parameters:
fileName - A string containing the file name of the hex's image reletive to the /media/ directory in the JAR file.

HexType

public HexType(java.lang.String fileName,
               java.awt.Color worldMapColor)
Creates a new instance of HexType
Parameters:
fileName - A string containing the file name of the hex's image reletive to the /media/ directory in the JAR file.
worldMapColor - The color of this tile for the world map viewer.

HexType

public HexType(java.lang.String fileName,
               java.awt.Color worldMapColor,
               boolean Passable)
Creates a new instance of HexType
Parameters:
fileName - A string containing the file name of the hex's image reletive to the /media/ directory in the JAR file.
worldMapColor - The color of this tile for the world map viewer.
Passable - true if this tile type can contain a unit, false otherwise.
Method Detail

draw

public void draw(GameViewer v,
                 Point3D pt)
Draws the HexType onto the backgound layer.
Parameters:
v - What to draw the tile on.
pt - Where to draw the tile. (in game space)

getColor

public java.awt.Color getColor()
Gets the color for the world map.
Returns:
Color for the world map.

getPassable

public boolean getPassable()
Gets whether or not the tile is passable.
Returns:
true if passable.

getDefaultStatus

public int getDefaultStatus()
Returns default status for Hex with this HexType. Currently only affected by passablility.
Returns:
The flag variable from Hex.