• 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
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 "kapman.h"
23 
24 Bonus::Bonus(qreal p_x, qreal p_y, Maze* p_maze, int p_points) : Element(p_x, p_y, p_maze) {
25  m_points = p_points;
26  m_type = Element::BONUS;
27 }
28 
29 Bonus::~Bonus() {
30 
31 }
32 
33 void Bonus::doActionOnCollision(Kapman* p_kapman) {
34  p_kapman->winPoints(this);
35 }
36 
37 void Bonus::setPoints(const int p_points) {
38  m_points = p_points;
39 }
40 
Element::m_points
int m_points
Points won when the Element is eaten.
Definition: element.h:69
Kapman::winPoints
void winPoints(Element *p_element)
Manages the points won.
Definition: kapman.cpp:135
Element::m_type
Type m_type
The Element type.
Definition: element.h:48
Bonus::Bonus
Bonus(qreal p_x, qreal p_y, Maze *p_maze, int p_points)
Creates a new Bonus instance.
Definition: bonus.cpp:24
Bonus::setPoints
void setPoints(const int p_points)
Sets the given value to the Bonus.
Definition: bonus.cpp:37
kapman.h
bonus.h
Element
This class describes the common characteristics and behaviour of any game Element (character or item)...
Definition: element.h:30
Bonus::~Bonus
~Bonus()
Deletes the Bonus instance.
Definition: bonus.cpp:29
Bonus::doActionOnCollision
void doActionOnCollision(Kapman *p_kapman)
Computes an action on a collision with the Kapman.
Definition: bonus.cpp:33
Kapman
This class represents the main character of the game.
Definition: kapman.h:26
Element::BONUS
Definition: element.h:42
Maze
This class represents the Maze of the game.
Definition: maze.h:31
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