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

libkdegames

KGrid2D::SquareBase

KGrid2D::SquareBase Class Reference

#include <KGrid2D>

Inheritance diagram for KGrid2D::SquareBase:

Inheritance graph
[legend]

List of all members.


Detailed Description

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

Definition at line 231 of file kgrid2d.h.


Public Types

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

Static Public Member Functions

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

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

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

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

Returns:
the neighbour for the given coordinate.

Definition at line 285 of file kgrid2d.h.

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

Returns:
the opposed neighbour.

Definition at line 261 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