File indexing completed on 2024-04-21 04:01:56

0001 /*
0002     SPDX-FileCopyrightText: 2007-2008 Thomas Gallinari <tg8187@yahoo.fr>
0003     SPDX-FileCopyrightText: 2007-2008 Gaƫl Courcelle <gael.courcelle@gmail.com>
0004     SPDX-FileCopyrightText: 2007-2008 Alexia Allanic <alexia_allanic@yahoo.fr>
0005     SPDX-FileCopyrightText: 2007-2008 Johann Hingue <yoan1703@hotmail.fr>
0006 
0007     SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 
0010 #ifndef BONUS_H
0011 #define BONUS_H
0012 
0013 #include "element.h"
0014 
0015 /**
0016  * @brief This class represents a Bonus for Kapman.
0017  */
0018 class Bonus : public Element
0019 {
0020     Q_OBJECT
0021 public:
0022     /**
0023      * Creates a new Bonus instance.
0024      * @param p_x the initial x-coordinate
0025      * @param p_y the initial y-coordinate
0026      * @param p_maze a reference to the Maze the Bonus will be on
0027      * @param p_points the value of the Bonus
0028      */
0029     Bonus(qreal p_x, qreal p_y, Maze *p_maze, int p_points);
0030 
0031     /**
0032      * Deletes the Bonus instance.
0033      */
0034     ~Bonus() override;
0035 
0036     /**
0037      * Computes an action on a collision with the Kapman.
0038      * @param p_kapman the Kapman instance that collides with the Bonus
0039      */
0040     void doActionOnCollision(Kapman *p_kapman) override;
0041 
0042     /**
0043      * Sets the given value to the Bonus.
0044      * @param p_points the value of the Bonus
0045      */
0046     void setPoints(const int p_points);
0047 };
0048 
0049 #endif