• 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
bonus.cpp
Go to the documentation of this file.
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  * Copyright 2007-2008 Johann Hingue <yoan1703@hotmail.fr>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 2 of
10  * the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #include "bonus.h"
22 #include "player.h"
23 
24 Bonus::Bonus(qreal p_x, qreal p_y, Arena* p_arena, Granatier::Bonus::Type bonusType) : Element(p_x, p_y, p_arena)
25 {
26  m_type = Granatier::Element::BONUS;
27  m_bonusType = bonusType;
28  m_taken = false;
29  m_destroyed = false;
30 }
31 
32 Bonus::~Bonus()
33 {
34 
35 }
36 
37 void Bonus::doActionOnCollision(Player* p_player)
38 {
39  p_player->addBonus(this);
40 }
41 
42 Granatier::Bonus::Type Bonus::getBonusType() const
43 {
44  return m_bonusType;
45 }
46 
47 void Bonus::setTaken()
48 {
49  m_taken = true;
50 }
51 
52 bool Bonus::isTaken() const
53 {
54  return m_taken;
55 }
56 
57 void Bonus::setDestroyed()
58 {
59  m_destroyed = true;
60  m_taken = true;
61 }
62 
63 bool Bonus::isDestroyed() const
64 {
65  return m_destroyed;
66 }
Element::m_type
Granatier::Element::Type m_type
The Element type.
Definition: element.h:39
Player::addBonus
void addBonus(Bonus *p_bonus)
Manages the points won.
Definition: player.cpp:514
Bonus::isDestroyed
bool isDestroyed() const
Definition: bonus.cpp:63
Bonus::getBonusType
Granatier::Bonus::Type getBonusType() const
Definition: bonus.cpp:42
Granatier::Element::BONUS
Definition: granatierglobals.h:95
Bonus::setDestroyed
void setDestroyed()
Definition: bonus.cpp:57
player.h
Arena
This class represents the Arena of the game.
Definition: arena.h:36
bonus.h
Bonus::setTaken
void setTaken()
Definition: bonus.cpp:47
Element
This class describes the common characteristics and behaviour of any game Element (character or item)...
Definition: element.h:32
Bonus::~Bonus
~Bonus()
Deletes the Bonus instance.
Definition: bonus.cpp:32
Bonus::doActionOnCollision
void doActionOnCollision(Player *p_player)
Computes an action on a collision with the Player.
Definition: bonus.cpp:37
Bonus::Bonus
Bonus(qreal p_x, qreal p_y, Arena *p_arena, Granatier::Bonus::Type bonusType)
Creates a new Bonus instance.
Definition: bonus.cpp:24
Player
This class represents the main character of the game.
Definition: player.h:33
Granatier::Bonus::Type
Type
Definition: granatierglobals.h:103
Bonus::isTaken
bool isTaken() const
Definition: bonus.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