KGrid2D::Square< T > Class Template Reference

This template is a Generic implementation for a square bidimensionnal grid (SquareBase). More...

#include <kgrid2d.h>

Inheritance diagram for KGrid2D::Square< T >:

Inheritance graph
[legend]
Collaboration diagram for KGrid2D::Square< T >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Square (uint width=0, uint height=0)
 Constructor.
CoordList neighbours (const Coord &c, bool insideOnly=true, bool directOnly=false) const
 
Returns:
the neighbours of coordinate

Coord toEdge (const Coord &c, Neighbour n) const
 
Returns:
the "projection" of the given coordinate on the grid edges.


Detailed Description

template<class T>
class KGrid2D::Square< T >

This template is a Generic implementation for a square bidimensionnal grid (SquareBase).

Definition at line 302 of file kgrid2d.h.


Constructor & Destructor Documentation

template<class T>
KGrid2D::Square< T >::Square ( uint  width = 0,
uint  height = 0 
) [inline]

Constructor.

Definition at line 308 of file kgrid2d.h.


Member Function Documentation

template<class T>
CoordList KGrid2D::Square< T >::neighbours ( const Coord c,
bool  insideOnly = true,
bool  directOnly = false 
) const [inline]

Returns:
the neighbours of coordinate

Parameters:
c to the given set of coordinates
c the coordinate to use as the reference point
insideOnly only add coordinates that are inside the grid.
directOnly only add the four nearest neighbours.

Definition at line 318 of file kgrid2d.h.

References KGrid2D::SquareBase::LeftUp, KGrid2D::SquareBase::Nb_Neighbour, and KGrid2D::SquareBase::neighbour().

Here is the call graph for this function:

template<class T>
Coord KGrid2D::Square< T >::toEdge ( const Coord c,
Neighbour  n 
) const [inline]

Returns:
the "projection" of the given coordinate on the grid edges.

Parameters:
c the coordinate to use as the reference point
n the direction of projection.

Definition at line 335 of file kgrid2d.h.

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


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