jtge.util.grid.builder
Interface IHexagonBuilder

All Known Implementing Classes:
AbstractHexagonBuilder

public interface IHexagonBuilder

Version:
$Id: IHexagonBuilder.java,v 1.1 2005/09/09 18:24:28 mat007 Exp $
Author:
Jean-Laurent

Method Summary
 java.awt.Polygon buildHexagon()
          Build a single hexagon.
 java.awt.Polygon buildHexagon(Coordinate coordinate)
          Build an hexagon within a map.
 int computeHeight(int height)
          Compute the height in pixels of a map consisting of given number of tiles height.
 int computeWidth(int width)
          Compute the width in pixels of a map consisting of given number of tiles width.
 Coordinate fromPixel(java.awt.Point point, IGrid grid)
          Picks the coordinate at a given screen coordinate in a grid.
 

Method Detail

buildHexagon

public java.awt.Polygon buildHexagon()
Build a single hexagon.

Returns:
the polygon

buildHexagon

public java.awt.Polygon buildHexagon(Coordinate coordinate)
Build an hexagon within a map.

Parameters:
coordinate - position of the hexagon
Returns:
the polygon

computeWidth

public int computeWidth(int width)
Compute the width in pixels of a map consisting of given number of tiles width.

Parameters:
width - a number of tiles
Returns:
the width in pixels

computeHeight

public int computeHeight(int height)
Compute the height in pixels of a map consisting of given number of tiles height.

Parameters:
height - a number of tiles
Returns:
the height in pixels

fromPixel

public Coordinate fromPixel(java.awt.Point point,
                            IGrid grid)
Picks the coordinate at a given screen coordinate in a grid.

Parameters:
point - the screen coordinate in pixels
grid - the grid to look into
Returns:
the corresponding coordinate or null if outside the grid


Copyright © 2003-2005 . All Rights Reserved.