File indexing completed on 2024-04-28 04:01:38

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 
0006     SPDX-License-Identifier: GPL-2.0-or-later
0007 */
0008 
0009 #ifndef BLOCK_H
0010 #define BLOCK_H
0011 
0012 #include "element.h"
0013 
0014 class Bonus;
0015 
0016 /**
0017  * @brief This class represents a block with the possibility of a bonus inside
0018  */
0019 class Block : public Element
0020 {
0021 
0022     Q_OBJECT
0023 
0024 public:
0025 
0026     /**
0027       * Creates a new Block instance.
0028       */
0029     Block(qreal p_x, qreal p_y, Arena* p_arena, const QString& p_imageId);
0030 
0031     /**
0032       * Deletes the Block instance.
0033       */
0034     ~Block() override;
0035 
0036     /**
0037       * Sets the Bonus which is contained by the Block
0038       * @param bonus the hidden Bonus
0039       */
0040     void setBonus(Bonus* bonus);
0041 
0042     /**
0043       * Returns the Bonus which is contained by the Block
0044       * @return the hidden Bonus
0045       */
0046     Bonus* getBonus();
0047 
0048     /**
0049       * destroys the block
0050       */
0051     void startDestruction();
0052 
0053 private:
0054     Bonus* m_bonus;
0055 
0056 Q_SIGNALS:
0057     void startDestructionAnimation();
0058 };
0059 
0060 #endif
0061