KGrid2D::SquareBase Class Reference

This class contains static methods to manipulate coordinates for a square bidimensionnal grid. More...

#include <kgrid2d.h>

Inheritance diagram for KGrid2D::SquareBase:

Inheritance graph
[legend]

List of all members.

Public Types

enum  Neighbour {
  Left = 0, Right, Up, Down,
  LeftUp, LeftDown, RightUp, RightDown,
  Nb_Neighbour
}
 Identify the eight neighbours. More...

Static Public Member Functions

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

static Neighbour opposed (Neighbour n)
 
Returns:
the opposed neighbour.

static bool isDirect (Neighbour n)
 
Returns:
true if the neighbour is a direct one (ie is one of the four nearest).

static Coord neighbour (const Coord &c, Neighbour n)
 
Returns:
the neighbour for the given coordinate.


Detailed Description

This class contains static methods to manipulate coordinates for a square bidimensionnal grid.

Definition at line 227 of file kgrid2d.h.


Member Enumeration Documentation

enum KGrid2D::SquareBase::Neighbour

Identify the eight neighbours.

Enumerator:
Left 
Right 
Up 
Down 
LeftUp 
LeftDown 
RightUp 
RightDown 
Nb_Neighbour 

Definition at line 233 of file kgrid2d.h.


Member Function Documentation

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

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

Definition at line 239 of file kgrid2d.h.

References Down, Left, LeftDown, LeftUp, Nb_Neighbour, Right, RightDown, RightUp, and Up.

static Neighbour KGrid2D::SquareBase::opposed ( Neighbour  n  )  [inline, static]

Returns:
the opposed neighbour.

Definition at line 257 of file kgrid2d.h.

References Down, Left, LeftDown, LeftUp, Nb_Neighbour, Right, RightDown, RightUp, and Up.

static bool KGrid2D::SquareBase::isDirect ( Neighbour  n  )  [inline, static]

Returns:
true if the neighbour is a direct one (ie is one of the four nearest).

Definition at line 276 of file kgrid2d.h.

References LeftUp.

static Coord KGrid2D::SquareBase::neighbour ( const Coord c,
Neighbour  n 
) [inline, static]

Returns:
the neighbour for the given coordinate.

Definition at line 281 of file kgrid2d.h.

References Down, Left, LeftDown, LeftUp, Nb_Neighbour, Right, RightDown, RightUp, and Up.

Referenced by KGrid2D::Square< T >::neighbours().


The documentation for this class was generated from the following file:
Generated on Sun Mar 16 08:03:27 2008 for Libkdegames by  doxygen 1.5.3