libkdegames Library API Documentation

KGrid2D::HexagonalBase Class Reference

This class contains static methods to manipulate coordinates on an hexagonal grid where hexagons form horizontal lines:. More...

#include <kgrid2d.h>

Inheritance diagram for KGrid2D::HexagonalBase:

KGrid2D::Hexagonal< Type > List of all members.

Public Types

enum  Neighbour {
  Left = 0, Right, LeftUp, LeftDown,
  RightUp, RightDown, Nb_Neighbour
}

Static Public Member Functions

double angle (Neighbour n)
Neighbour opposed (Neighbour n)
Coord neighbour (const Coord &c, Neighbour n)
uint distance (const Coord &c1, const Coord &c2)

Detailed Description

This class contains static methods to manipulate coordinates on an hexagonal grid where hexagons form horizontal lines:.

 (0,0)   (0,1)   (0,2)
     (1,0)   (1,1)   (1,2)
 (2,0)   (2,1)   (2,2)
 

Since:
3.2

Definition at line 372 of file kgrid2d.h.


Member Enumeration Documentation

enum KGrid2D::HexagonalBase::Neighbour
 

Identify the six neighbours.

Definition at line 378 of file kgrid2d.h.

Referenced by opposed().


Member Function Documentation

double KGrid2D::HexagonalBase::angle Neighbour  n  )  [inline, static]
 

Returns:
the trigonometric angle in radians for the given neighbour.

Definition at line 384 of file kgrid2d.h.

References angle().

Referenced by angle().

Neighbour KGrid2D::HexagonalBase::opposed Neighbour  n  )  [inline, static]
 

Returns:
the opposed neighbour.

Definition at line 400 of file kgrid2d.h.

References Neighbour, and opposed().

Referenced by opposed().

Coord KGrid2D::HexagonalBase::neighbour const Coord c,
Neighbour  n
[inline, static]
 

Returns:
the neighbour of the given coordinate.

Definition at line 416 of file kgrid2d.h.

References neighbour().

Referenced by neighbour().

uint KGrid2D::HexagonalBase::distance const Coord c1,
const Coord c2
[inline, static]
 

Returns:
the distance between the two coordinates in term of hexagons.

Definition at line 433 of file kgrid2d.h.

References distance().

Referenced by distance().


The documentation for this class was generated from the following file:
KDE Logo
This file is part of the documentation for libkdegames Library Version 3.2.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Jul 28 14:18:47 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003