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

granatier

  • sources
  • kde-4.14
  • kdegames
  • granatier
  • src
cell.h
Go to the documentation of this file.
1 /*
2  * Copyright 2009 Mathias Kraus <k.hias@gmx.de>
3  * Copyright 2007-2008 Thomas Gallinari <tg8187@yahoo.fr>
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License as
7  * published by the Free Software Foundation; either version 2 of
8  * the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef CELL_H
20 #define CELL_H
21 
22 #include "element.h"
23 
24 #include <QList>
25 
29 class Cell
30 {
31 private:
32 
34  Granatier::Cell::Type m_type;
35 
37  QList<Element*> m_elements;
38 
39 public:
40 
44  Cell();
45 
49  ~Cell();
50 
55  bool isWalkable(Element* p_element) const;
56 
61  Granatier::Cell::Type getType() const;
62 
67  void setType(Granatier::Cell::Type p_type);
68 
73  QList <Element*> getElements() const;
74 
79  QList <Element*> getElements(Granatier::Element::Type type) const;
80 
85  void setElement(Element* p_element);
86 
91  void removeElement(Element* p_element);
92 };
93 
94 #endif
95 
Cell::setElement
void setElement(Element *p_element)
Sets the Element that is on the Cell.
Definition: cell.cpp:80
element.h
Cell
This class represents a Cell of the Arena.
Definition: cell.h:29
Cell::getElements
QList< Element * > getElements() const
Gets all the Elements that are on the Cell.
Definition: cell.cpp:62
QList< Element * >
Cell::~Cell
~Cell()
Deletes the Cell instance.
Definition: cell.cpp:26
Granatier::Element::Type
Type
Definition: granatierglobals.h:89
Element
This class describes the common characteristics and behaviour of any game Element (character or item)...
Definition: element.h:32
Cell::setType
void setType(Granatier::Cell::Type p_type)
Sets the Cell type.
Definition: cell.cpp:57
Granatier::Cell::Type
Type
Definition: granatierglobals.h:71
Cell::isWalkable
bool isWalkable(Element *p_element) const
Returns if it is possible to move into the cell or not, because of a wall, bomb, etc.
Definition: cell.cpp:30
Cell::Cell
Cell()
Creates a new Cell instance.
Definition: cell.cpp:21
Cell::removeElement
void removeElement(Element *p_element)
Removes the Element that is on the Cell.
Definition: cell.cpp:88
Cell::getType
Granatier::Cell::Type getType() const
Gets the Cell type.
Definition: cell.cpp:52
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:10 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

granatier

Skip menu "granatier"
  • Main Page
  • Namespace List
  • Namespace Members
  • 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