map
Class Tile

java.lang.Object
  extended by map.Tile

public class Tile
extends java.lang.Object

Author:
Shannon Smith

Nested Class Summary
static class Tile.TileType
           
 
Constructor Summary
Tile(GameMap map, int x, int y, Tile.TileType type)
           
 
Method Summary
 void addFeature(Feature feature)
           
 int distanceTo(Tile tile)
          Manhattan distance.
 void draw()
           
 void drawFeatures()
           
 float fade(float n)
           
 void generateMesh(MapVertex v1, MapVertex v2, MapVertex v3, MapVertex v4)
           
 Vector3f getCenter()
           
 float getCornerHeight(GameMath.MapDir dir)
           
 float getHeightAt(float x, float y)
           
 Tile getNeighbour(GameMap map, GameMath.MapDir dir)
           
 MapTri getRoamTriLeft()
           
 MapTri getRoamTriRight()
           
 Tile.TileType getType()
           
 int getX()
           
 int getY()
           
 boolean hasFeatures()
           
 boolean isLocked()
           
 void linkMesh(GameMap map)
           
 void lock()
           
 void setType(Tile.TileType type)
           
 void splitMesh(GameMap map)
           
 java.lang.String toString()
           
 boolean unitCanEnter()
           
 void unlock()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Tile

public Tile(GameMap map,
            int x,
            int y,
            Tile.TileType type)
Method Detail

getType

public Tile.TileType getType()

getCenter

public Vector3f getCenter()

setType

public void setType(Tile.TileType type)

getX

public int getX()

getY

public int getY()

addFeature

public void addFeature(Feature feature)

lock

public void lock()

unlock

public void unlock()

isLocked

public boolean isLocked()

getCornerHeight

public float getCornerHeight(GameMath.MapDir dir)

getHeightAt

public float getHeightAt(float x,
                         float y)
Parameters:
x - float between 0 and 1
y - float between 0 and 1
Returns:

getNeighbour

public Tile getNeighbour(GameMap map,
                         GameMath.MapDir dir)

fade

public float fade(float n)

unitCanEnter

public boolean unitCanEnter()

getRoamTriLeft

public MapTri getRoamTriLeft()

getRoamTriRight

public MapTri getRoamTriRight()

generateMesh

public void generateMesh(MapVertex v1,
                         MapVertex v2,
                         MapVertex v3,
                         MapVertex v4)

splitMesh

public void splitMesh(GameMap map)

linkMesh

public void linkMesh(GameMap map)

draw

public void draw()

hasFeatures

public boolean hasFeatures()

drawFeatures

public void drawFeatures()

distanceTo

public int distanceTo(Tile tile)
Manhattan distance.

Parameters:
tile -
Returns:

toString

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