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

kapman

  • sources
  • kde-4.14
  • kdegames
  • kapman
cell.h
Go to the documentation of this file.
1 /*
2  * Copyright 2007-2008 Thomas Gallinari <tg8187@yahoo.fr>
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; either version 2 of
7  * the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef CELL_H
19 #define CELL_H
20 
21 #include <QtGlobal>
22 
23 class Element;
24 
28 class Cell {
29 
30  public:
31 
33  static const qreal SIZE;
34 
36  enum Type {
37  WALL = 0,
38  CORRIDOR = 1,
39  GHOSTCAMP = 2
40  };
41 
42  private:
43 
45  Type m_type;
46 
48  Element* m_element;
49 
51  int m_cost;
52 
54  Cell* m_parent;
55 
56  public:
57 
61  Cell();
62 
66  ~Cell();
67 
72  Type getType() const;
73 
78  void setType(Type p_type);
79 
84  Element* getElement() const;
85 
90  void setElement(Element* p_element);
91 
96  int getCost() const;
97 
102  void setCost(const int p_cost);
103 
108  Cell* getParent() const;
109 
114  void setParent(Cell* p_parent);
115 };
116 
117 #endif
118 
Cell::setElement
void setElement(Element *p_element)
Sets the Element that is on the Cell.
Definition: cell.cpp:43
Cell::WALL
Definition: cell.h:37
Cell::getElement
Element * getElement() const
Gets the Element that is on the Cell.
Definition: cell.cpp:39
Cell
This class represents a Cell of the Maze.
Definition: cell.h:28
Cell::getType
Type getType() const
Gets the Cell type.
Definition: cell.cpp:31
Cell::getParent
Cell * getParent() const
Gets the parent Cell of this Cell for A* pathfinding algorithm.
Definition: cell.cpp:55
Cell::getCost
int getCost() const
Gets the Cell cost for A* pathfinding algorithm.
Definition: cell.cpp:47
Cell::setCost
void setCost(const int p_cost)
Sets a cost for the Cell, for A* pathfinding algorithm.
Definition: cell.cpp:51
Cell::SIZE
static const qreal SIZE
The Cell side size.
Definition: cell.h:33
Cell::CORRIDOR
Definition: cell.h:38
Cell::~Cell
~Cell()
Deletes the Cell instance.
Definition: cell.cpp:26
Element
This class describes the common characteristics and behaviour of any game Element (character or item)...
Definition: element.h:30
Cell::GHOSTCAMP
Definition: cell.h:39
Cell::setParent
void setParent(Cell *p_parent)
Sets the parent Cell of this Cell for A* pathfinding algorithm.
Definition: cell.cpp:59
Cell::setType
void setType(Type p_type)
Sets the Cell type.
Definition: cell.cpp:35
Cell::Type
Type
The Cell possible types.
Definition: cell.h:36
Cell::Cell
Cell()
Creates a new Cell instance.
Definition: cell.cpp:23
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:15 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