2 * Copyright 2007-2008 Thomas Gallinari <tg8187@yahoo.fr>
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.
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.
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/>.
26 * @brief This class represents a Cell of the Maze.
32 /** The Cell side size */
33 static const qreal SIZE
;
35 /** The Cell possible types */
47 /** A reference on the Element that is on the Cell */
50 /** Cost used in A* pathfinding algorithm : lower is the cost, closer to the target Cell is this Cell */
53 /** Parent node used in A* pathfinding algorithm : the Cell which enables to go to this Cell */
59 * Creates a new Cell instance.
64 * Deletes the Cell instance.
70 * @return the Cell type
76 * @param p_type the new type to set
78 void setType(Type p_type
);
81 * Gets the Element that is on the Cell.
82 * @return the Element that is on the Cell
84 Element
* getElement();
87 * Sets the Element that is on the Cell.
88 * @param p_element the Element to set on the Cell
90 void setElement(Element
* p_element
);
93 * Gets the Cell cost for A* pathfinding algorithm.
94 * @return the Cell cost for A* pathfinding algorithm
99 * Sets a cost for the Cell, for A* pathfinding algorithm.
100 * @param p_cost the cost of the Cell for A* pathfinding algorithm
102 void setCost(const int p_cost
);
105 * Gets the parent Cell of this Cell for A* pathfinding algorithm.
106 * @return the Cell parent for A* pathfinding algorithm
108 Cell
* getParent() const;
111 * Sets the parent Cell of this Cell for A* pathfinding algorithm.
112 * @param p_parent the parent of the Cell for A* pathfinding algorithm
114 void setParent(Cell
* p_parent
);