• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • libtdegames
 

libtdegames

  • KGrid2D
  • HexagonalBase
Public Types | Static Public Member Functions | List of all members
KGrid2D::HexagonalBase Class Reference

#include <kgrid2d.h>

Inheritance diagram for KGrid2D::HexagonalBase:
KGrid2D::Hexagonal< Type >

Public Types

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

Static Public Member Functions

static double angle (Neighbour n)
 
static Neighbour opposed (Neighbour n)
 
static Coord neighbour (const Coord &c, Neighbour n)
 
static 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

◆ Neighbour

enum KGrid2D::HexagonalBase::Neighbour

Identify the six neighbours.

Definition at line 378 of file kgrid2d.h.

Member Function Documentation

◆ angle()

static double KGrid2D::HexagonalBase::angle ( Neighbour  n)
inlinestatic
Returns
the trigonometric angle in radians for the given neighbour.

Definition at line 384 of file kgrid2d.h.

◆ distance()

static uint KGrid2D::HexagonalBase::distance ( const Coord &  c1,
const Coord &  c2 
)
inlinestatic
Returns
the distance between the two coordinates in term of hexagons.

Definition at line 433 of file kgrid2d.h.

◆ neighbour()

static Coord KGrid2D::HexagonalBase::neighbour ( const Coord &  c,
Neighbour  n 
)
inlinestatic
Returns
the neighbour of the given coordinate.

Definition at line 416 of file kgrid2d.h.

◆ opposed()

static Neighbour KGrid2D::HexagonalBase::opposed ( Neighbour  n)
inlinestatic
Returns
the opposed neighbour.

Definition at line 400 of file kgrid2d.h.


The documentation for this class was generated from the following file:
  • kgrid2d.h

libtdegames

Skip menu "libtdegames"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

libtdegames

Skip menu "libtdegames"
  • libtdegames
Generated for libtdegames by doxygen 1.9.4
This website is maintained by Timothy Pearson.