libkdegames Library API Documentation

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:

KGrid2D::Square< T > List of all members.

Public Types

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

Static Public Methods

double angle (Neighbour n)
Neighbour opposed (Neighbour n)
bool isDirect (Neighbour n)
Coord neighbour (const Coord &c, Neighbour n)

Detailed Description

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

Since:
3.2

Definition at line 234 of file kgrid2d.h.


Member Enumeration Documentation

enum KGrid2D::SquareBase::Neighbour
 

Identify the eight neighbours.

Definition at line 240 of file kgrid2d.h.

Referenced by angle(), isDirect(), neighbour(), KGrid2D::Square< T >::neighbours(), opposed(), and KGrid2D::Square< T >::toEdge().


Member Function Documentation

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

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

Definition at line 246 of file kgrid2d.h.

References Neighbour.

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

Returns:
the opposed neighbour.

Definition at line 264 of file kgrid2d.h.

References Neighbour.

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 283 of file kgrid2d.h.

References Neighbour.

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

Returns:
the neighbour for the given coordinate.

Definition at line 288 of file kgrid2d.h.

References Neighbour.

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


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.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat May 1 10:06:40 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003