1 | /* |
2 | * Copyright 2007-2008 Thomas Gallinari <tg8187@yahoo.fr> |
3 | * Copyright 2007-2008 Gaƫl Courcelle <gael.courcelle@gmail.com> |
4 | * Copyright 2007-2008 Alexia Allanic <alexia_allanic@yahoo.fr> |
5 | * |
6 | * This program is free software; you can redistribute it and/or |
7 | * modify it under the terms of the GNU General Public License as |
8 | * published by the Free Software Foundation; either version 2 of |
9 | * the License, or (at your option) any later version. |
10 | * |
11 | * This program is distributed in the hope that it will be useful, |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | * GNU General Public License for more details. |
15 | * |
16 | * You should have received a copy of the GNU General Public License |
17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 | */ |
19 | |
20 | #include "energizer.h" |
21 | #include "kapman.h" |
22 | |
23 | const int Energizer::POINTS = 50; |
24 | |
25 | Energizer::Energizer(qreal p_x, qreal p_y, Maze* p_maze, const QString& p_imageId) : Element(p_x, p_y, p_maze) { |
26 | Element::setImageId(p_imageId); |
27 | m_points = Energizer::POINTS; |
28 | m_type = Element::ENERGYZER; |
29 | } |
30 | |
31 | Energizer::~Energizer() { |
32 | } |
33 | |
34 | void Energizer::doActionOnCollision(Kapman* p_kapman) { |
35 | p_kapman->winPoints(this); |
36 | // Tell to the maze that an element was eaten |
37 | m_maze->decrementNbElem(); |
38 | } |
39 | |
40 | |