• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdegames API Reference
  • KDE Home
  • Contact Us
 

kapman

Signals | Public Member Functions | List of all members
Maze Class Reference

#include <maze.h>

Inheritance diagram for Maze:
Inheritance graph
[legend]

Signals

void allElementsEaten ()
 

Public Member Functions

 Maze ()
 
 ~Maze ()
 
void decrementNbElem ()
 
Cell getCell (const int p_row, const int p_column) const
 
int getColFromX (const qreal p_x) const
 
QPoint getCoords (Cell *p_cell) const
 
int getNbColumns () const
 
int getNbElem () const
 
int getNbRows () const
 
QList< QPoint > getPathToGhostCamp (const int p_row, const int p_column) const
 
QPoint getResurrectionCell () const
 
int getRowFromY (const qreal p_y) const
 
int getTotalNbElem () const
 
void init (const int p_nbRows, const int p_nbColumns)
 
void resetNbElem ()
 
void setCellElement (const int p_row, const int p_column, Element *p_element)
 
void setCellType (const int p_row, const int p_column, const Cell::Type p_type)
 
void setResurrectionCell (QPoint p_resurrectionCell)
 

Detailed Description

This class represents the Maze of the game.

Definition at line 31 of file maze.h.

Constructor & Destructor Documentation

Maze::Maze ( )

Creates a new Maze instance.

Definition at line 25 of file maze.cpp.

Maze::~Maze ( )

Deletes the Maze instance.

Definition at line 29 of file maze.cpp.

Member Function Documentation

void Maze::allElementsEaten ( )
signal

Emitted when all the elements on the Maze have been eaten.

void Maze::decrementNbElem ( )

Decrements the number of remaining Elements.

Definition at line 69 of file maze.cpp.

Cell Maze::getCell ( const int  p_row,
const int  p_column 
) const

Gets the Cell at the given coordinates.

Parameters
p_rowthe row index
p_columnthe column index
Returns
the Cell at the given row and column

Definition at line 180 of file maze.cpp.

int Maze::getColFromX ( const qreal  p_x) const

Gets the column index corresponding to the given x-coordinate.

Parameters
p_xthe x-coordinate to convert into column index
Returns
the column index corresponding to the given x-coordinate

Definition at line 203 of file maze.cpp.

QPoint Maze::getCoords ( Cell *  p_cell) const

Gets the coordinates of the given Cell as a QPoint.

Parameters
p_cellthe searched Cell
Returns
the row and column of the given Cell

Definition at line 188 of file maze.cpp.

int Maze::getNbColumns ( ) const

Gets the number of columns of the Maze.

Returns
the number of columns

Definition at line 207 of file maze.cpp.

int Maze::getNbElem ( ) const

Gets the number of remaining Elements still on the Maze.

Returns
the number of remaining Elements

Definition at line 215 of file maze.cpp.

int Maze::getNbRows ( ) const

Gets the number of rows of the Maze.

Returns
the number of rows

Definition at line 211 of file maze.cpp.

QList< QPoint > Maze::getPathToGhostCamp ( const int  p_row,
const int  p_column 
) const

Gets the path, as a list of Cell coordinates, to go to the Ghost camp from the Cell whose coordinates are given in parameters.

This algorithm has been made from the A* algorithm.

Parameters
p_rowthe row index of the starting Cell
p_columnthe column index of the starting Cell
Returns
a list of Cell coordinates to go to the Ghost camp

Definition at line 80 of file maze.cpp.

QPoint Maze::getResurrectionCell ( ) const

Gets the cell on witch the ghosts resurects.

Returns
the cell on witch the ghosts resurects

Definition at line 223 of file maze.cpp.

int Maze::getRowFromY ( const qreal  p_y) const

Gets the row index corresponding to the given y-coordinate.

Parameters
p_ythe y-coordinate to convert into row index
Returns
the row index corresponding to the given y-coordinate

Definition at line 199 of file maze.cpp.

int Maze::getTotalNbElem ( ) const

Gets the number of Elements initially on the Maze.

Returns
the initial number of Elements

Definition at line 219 of file maze.cpp.

void Maze::init ( const int  p_nbRows,
const int  p_nbColumns 
)

Creates the Maze matrix.

Parameters
p_nbRowsthe number of rows
p_nbColumnsthe number of columns

Definition at line 36 of file maze.cpp.

void Maze::resetNbElem ( )

Resets the number of remaining Elements to the initial number.

Definition at line 76 of file maze.cpp.

void Maze::setCellElement ( const int  p_row,
const int  p_column,
Element *  p_element 
)

Sets the Element that is on the Cell whose coordinates are given in parameters.

Parameters
p_rowthe Cell row
p_columnthe Cell column
p_elementthe Element that is on the Cell

Definition at line 52 of file maze.cpp.

void Maze::setCellType ( const int  p_row,
const int  p_column,
const Cell::Type  p_type 
)

Sets the CellType of the Cell whose coordinates are given in parameters.

Parameters
p_rowthe Cell row
p_columnthe Cell column
p_typethe Cell type

Definition at line 45 of file maze.cpp.

void Maze::setResurrectionCell ( QPoint  p_resurrectionCell)

Sets the cell on witch the ghosts resurrect from prey state.

Parameters
p_resurrectionCellthe cell on witch the ghosts resurrect

Definition at line 63 of file maze.cpp.


The documentation for this class was generated from the following files:
  • maze.h
  • maze.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:44:03 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kapman

Skip menu "kapman"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdegames API Reference

Skip menu "kdegames API Reference"
  • granatier
  • kapman
  • kblackbox
  • kgoldrunner
  • kigo
  • kmahjongg
  • KShisen
  • ksquares
  • libkdegames
  •   highscore
  •   libkdegamesprivate
  •     kgame
  • libkmahjongg
  • palapeli
  •   libpala

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal