|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jtge.util.grid.builder.AbstractHexagonBuilder
Field Summary | |
protected double |
A
| A |
|R| _ _
/\ H
/ \ _
| | S B
| | _
\ /
\/ _
| B |
|H||S|
___ _ _
/ \ R
/ \ _ A
\ /
\___/ _
|
protected double |
B
| A |
|R| _ _
/\ H
/ \ _
| | S B
| | _
\ /
\/ _
| B |
|H||S|
___ _ _
/ \ R
/ \ _ A
\ /
\___/ _
|
protected double |
H
| A |
|R| _ _
/\ H
/ \ _
| | S B
| | _
\ /
\/ _
| B |
|H||S|
___ _ _
/ \ R
/ \ _ A
\ /
\___/ _
|
protected double |
R
| A |
|R| _ _
/\ H
/ \ _
| | S B
| | _
\ /
\/ _
| B |
|H||S|
___ _ _
/ \ R
/ \ _ A
\ /
\___/ _
|
protected double |
S
| A |
|R| _ _
/\ H
/ \ _
| | S B
| | _
\ /
\/ _
| B |
|H||S|
___ _ _
/ \ R
/ \ _ A
\ /
\___/ _
|
protected boolean |
shifted
Whether the map is shifted or not. |
Constructor Summary | |
AbstractHexagonBuilder(int hexagonSideLength,
boolean shifted)
Create an abstract hexagon builder. |
Method Summary | |
protected abstract Coordinate |
approximate(java.awt.Point point)
Retrieve an approximated coordinate from a given point. |
java.awt.Polygon |
buildHexagon()
Build a single hexagon. |
protected int |
floor(double value)
Floor a number. |
protected int[] |
floor(double[] array)
Floor an array of numbers. |
Coordinate |
fromPixel(java.awt.Point point,
IGrid grid)
Picks the coordinate at a given screen coordinate in a grid. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface jtge.util.grid.builder.IHexagonBuilder |
buildHexagon, computeHeight, computeWidth |
Field Detail |
protected final double S
| A |
|R| _ _
/\ H
/ \ _
| | S B
| | _
\ /
\/ _
| B |
|H||S|
___ _ _
/ \ R
/ \ _ A
\ /
\___/ _
protected final double R
| A |
|R| _ _
/\ H
/ \ _
| | S B
| | _
\ /
\/ _
| B |
|H||S|
___ _ _
/ \ R
/ \ _ A
\ /
\___/ _
protected final double H
| A |
|R| _ _
/\ H
/ \ _
| | S B
| | _
\ /
\/ _
| B |
|H||S|
___ _ _
/ \ R
/ \ _ A
\ /
\___/ _
protected final double A
| A |
|R| _ _
/\ H
/ \ _
| | S B
| | _
\ /
\/ _
| B |
|H||S|
___ _ _
/ \ R
/ \ _ A
\ /
\___/ _
protected final double B
| A |
|R| _ _
/\ H
/ \ _
| | S B
| | _
\ /
\/ _
| B |
|H||S|
___ _ _
/ \ R
/ \ _ A
\ /
\___/ _
protected final boolean shifted
Constructor Detail |
public AbstractHexagonBuilder(int hexagonSideLength, boolean shifted)
hexagonSideLength
- the length of the side of an hexagon in pixelsshifted
- whether to shift the first hexagon (therefore the whole map) or notMethod Detail |
public final java.awt.Polygon buildHexagon()
buildHexagon
in interface IHexagonBuilder
public final Coordinate fromPixel(java.awt.Point point, IGrid grid)
fromPixel
in interface IHexagonBuilder
point
- the screen coordinate in pixelsgrid
- the grid to look into
protected abstract Coordinate approximate(java.awt.Point point)
point
- the point
protected final int[] floor(double[] array)
array
- the array to floor
protected final int floor(double value)
value
- the double value to floor.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |