• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

libkdegames

KGrid2D::Hexagonal

KGrid2D::Hexagonal< Type > Class Template Reference

#include <kgrid2d.h>

Inheritance diagram for KGrid2D::Hexagonal< Type >:

Inheritance graph
[legend]

List of all members.


Detailed Description

template<class Type>
class KGrid2D::Hexagonal< Type >

This template implements a 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)
 

Definition at line 438 of file kgrid2d.h.


Public Member Functions

 Hexagonal (uint width=0, uint height=0)
CoordList neighbours (const Coord &c, bool insideOnly=true) const
CoordList neighbours (const Coord &c, uint distance, bool all, bool insideOnly=true) const

Constructor & Destructor Documentation

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

Constructor.

Definition at line 444 of file kgrid2d.h.


Member Function Documentation

template<class Type>
CoordList KGrid2D::Hexagonal< Type >::neighbours ( const Coord &  c,
bool  insideOnly = true 
) const [inline]

Returns:
the neighbours of coordinate

Parameters:
c to the given set of coordinates
c the coordiante to use as the reference point
insideOnly only add coordinates that are inside the grid.

Definition at line 453 of file kgrid2d.h.

template<class Type>
CoordList KGrid2D::Hexagonal< Type >::neighbours ( const Coord &  c,
uint  distance,
bool  all,
bool  insideOnly = true 
) const [inline]

Returns:
the neighbours at distance

Parameters:
distance of coordinate
c the coordinate to use as the reference point
distance distance to the neighbour (1 means at contact).
insideOnly only add coordinates that are inside the grid.
all returns all neighbours at distance equal and less than
distance (the original coordinate is not included).

Definition at line 472 of file kgrid2d.h.


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

libkdegames

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

API Reference

Skip menu "API Reference"
  • kblackbox
  • kgoldrunner
  • kmahjongg
  • ksquares
  • libkdegames
  •   highscore
  •   kgame
  •   kggzgames
  •   kggzmod
  •   kggznet
  • libkmahjongg
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal