jtge.util.grid.directiongroup
Class AbstractFlatHexagonDirectionGroup

java.lang.Object
  extended byjtge.util.grid.directiongroup.AbstractDirectionGroup
      extended byjtge.util.grid.directiongroup.AbstractFlatHexagonDirectionGroup
All Implemented Interfaces:
IDirectionGroup
Direct Known Subclasses:
FlatHexagonDirectionGroup, FlatShiftedHexagonDirectionGroup

public abstract class AbstractFlatHexagonDirectionGroup
extends AbstractDirectionGroup

Abstract Hexagon Direction Group for Flat Hexagon Grid.

Version:
$Id: AbstractFlatHexagonDirectionGroup.java,v 1.3 2005/09/10 11:23:52 mat007 Exp $
Author:
Jean-Laurent Fabre de Morlhon

Constructor Summary
AbstractFlatHexagonDirectionGroup()
          Create an abstract flat hexagon direction group.
 
Method Summary
protected abstract  boolean shift(Coordinate coordinate)
          Test if a given coordinate must be shifted.
 Coordinate transform(Coordinate coordinate, East direction)
          Retrieve the coordinate next to another in a given direction.
 Coordinate transform(Coordinate coordinate, North direction)
          Retrieve the coordinate next to another in a given direction.
 Coordinate transform(Coordinate coordinate, NorthEast direction)
          Retrieve the coordinate next to another in a given direction.
 Coordinate transform(Coordinate coordinate, NorthWest direction)
          Retrieve the coordinate next to another in a given direction.
 Coordinate transform(Coordinate coordinate, South direction)
          Retrieve the coordinate next to another in a given direction.
 Coordinate transform(Coordinate coordinate, SouthEast direction)
          Retrieve the coordinate next to another in a given direction.
 Coordinate transform(Coordinate coordinate, SouthWest direction)
          Retrieve the coordinate next to another in a given direction.
 Coordinate transform(Coordinate coordinate, West direction)
          Retrieve the coordinate next to another in a given direction.
 
Methods inherited from class jtge.util.grid.directiongroup.AbstractDirectionGroup
add, getNames, getShortNames, iterator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractFlatHexagonDirectionGroup

public AbstractFlatHexagonDirectionGroup()
Create an abstract flat hexagon direction group.

Method Detail

shift

protected abstract boolean shift(Coordinate coordinate)
Test if a given coordinate must be shifted.

Parameters:
coordinate - the coordinate
Returns:
whether the coordinate must be shifted or not

transform

public final Coordinate transform(Coordinate coordinate,
                                  NorthEast direction)
Retrieve the coordinate next to another in a given direction.

Parameters:
coordinate - the origin
direction - the direction
Returns:
a coordinate

transform

public final Coordinate transform(Coordinate coordinate,
                                  NorthWest direction)
Retrieve the coordinate next to another in a given direction.

Parameters:
coordinate - the origin
direction - the direction
Returns:
a coordinate

transform

public final Coordinate transform(Coordinate coordinate,
                                  SouthEast direction)
Retrieve the coordinate next to another in a given direction.

Parameters:
coordinate - the origin
direction - the direction
Returns:
a coordinate

transform

public final Coordinate transform(Coordinate coordinate,
                                  SouthWest direction)
Retrieve the coordinate next to another in a given direction.

Parameters:
coordinate - the origin
direction - the direction
Returns:
a coordinate

transform

public final Coordinate transform(Coordinate coordinate,
                                  North direction)
Retrieve the coordinate next to another in a given direction.

Parameters:
coordinate - the origin
direction - the direction
Returns:
a coordinate

transform

public final Coordinate transform(Coordinate coordinate,
                                  South direction)
Retrieve the coordinate next to another in a given direction.

Parameters:
coordinate - the origin
direction - the direction
Returns:
a coordinate

transform

public final Coordinate transform(Coordinate coordinate,
                                  West direction)
Retrieve the coordinate next to another in a given direction.

Parameters:
coordinate - the origin
direction - the direction
Returns:
a coordinate

transform

public final Coordinate transform(Coordinate coordinate,
                                  East direction)
Retrieve the coordinate next to another in a given direction.

Parameters:
coordinate - the origin
direction - the direction
Returns:
a coordinate


Copyright © 2003-2005 . All Rights Reserved.