|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjecthexIT.Board
This class represents a configuration of hexagons, a "board". There can be many possibilities for how to layout the Hexagons(tiles) on the board. These specific arrangements are abstractly defined here, and left to be implemented by subclasses. This base class contains all the functions that can be used by all board types.
Constructor Summary | |
Board()
Creates a new, empty Board. |
|
Board(int new_size)
Creates a new board of the specified size. |
Method Summary | |
void |
createFrame(java.lang.String name)
Creates a Frame to view this board in. |
abstract int |
distance(Hexagon h1,
Hexagon h2)
A distance metric between 2 separate hexagons. |
Hexagon |
findObject(Drawable obj)
Finds an object that is on one of the hexagons. |
abstract java.util.List |
getExterior()
Returns the exterior of the hexagonal board. |
abstract java.util.List |
getFOV(int hexx1,
int hexy1,
int maxradius)
Gets all the hexes that can be "seen" in the Field-of-View of an observer at hex coordinate (hexx1,hexy1). |
abstract java.util.List |
getLOS(int hexx1,
int hexy1,
int hexx2,
int hexy2)
Gets all the hexes that can be "seen" from one hexagon to another. |
abstract java.util.List |
getShortestPath(int hexx1,
int hexy1,
int hexx2,
int hexy2)
Returns the shortest path (a list of haxagons) from hex locations (hexy1,hexy2) to (hexx2, hexy2); |
abstract java.util.List |
getSurrounding(int hexx,
int hexy,
int radius)
Gets all the hexes surrounding the hexes at hex coords (x,y) within a specified radius (in hex units). |
void |
setFrameSize(int new_width,
int new_height)
Sets the size of the frame, in pixels, to the specified values. |
void |
show()
Show the internal frame created by createFrame(). |
abstract java.util.Iterator |
tilesIterator()
Returns an iterator over all hexagons in the board, in no particular order. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Board()
public Board(int new_size)
Method Detail |
public void createFrame(java.lang.String name)
public void setFrameSize(int new_width, int new_height)
public void show()
public abstract java.util.List getSurrounding(int hexx, int hexy, int radius)
public abstract java.util.List getLOS(int hexx1, int hexy1, int hexx2, int hexy2)
public abstract java.util.List getFOV(int hexx1, int hexy1, int maxradius)
public abstract java.util.List getShortestPath(int hexx1, int hexy1, int hexx2, int hexy2)
public abstract java.util.List getExterior()
public abstract int distance(Hexagon h1, Hexagon h2)
public abstract java.util.Iterator tilesIterator()
public Hexagon findObject(Drawable obj)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |