1 /*************************************************************************** 2 backgnd.h - description 3 ------------------- 4 begin : Wed Jul 18 2001 5 copyright : (C) 2001-2006 by Gael de Chalendar (aka Kleag) 6 email : kleag@free.fr 7 ***************************************************************************/ 8 9 /*************************************************************************** 10 * * 11 * This program is free software; you can redistribute it and/or modify * 12 * it under the terms of the GNU General Public License as published by * 13 * the Free Software Foundation; either either version 2 14 of the License, or (at your option) any later version.of the License, or * 15 * (at your option) any later version. * 16 * * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 20 * 02110-1301, USA 21 ***************************************************************************/ 22 #define KDE_NO_COMPAT 23 24 #ifndef BACKGND_H 25 #define BACKGND_H 26 27 #include "decoratedgameframe.h" 28 #include <QGraphicsItem> 29 #include <QGraphicsScene> 30 #include <KConfig> 31 #include <KConfigGroup> 32 33 namespace Ksirk 34 { 35 namespace GameLogic 36 { 37 class ONU; 38 } 39 40 /** 41 * BackGnd is the sprite used to display the background map image 42 */ 43 class BackGnd : public QGraphicsPixmapItem 44 { 45 public: 46 /** 47 * Constructor. 48 * @param scene The canvas where all the sprites are set up. 49 * @param theWorld The world represented by this background 50 */ 51 BackGnd(QGraphicsScene *scene, const GameLogic::ONU* theWorld, bool arena = false); 52 53 /** 54 * Default destructor 55 */ 56 ~BackGnd() override; 57 onu()58 inline const GameLogic::ONU* onu() const {return m_theWorld;} 59 bgIsArena()60 inline bool bgIsArena() const {return m_bgIsArena;} 61 62 protected: 63 /** 64 * Reimplemented of the inherited one to let the event be transmitted to the 65 * parent widget. 66 * @param unused 67 * @return false: the event is not handled here. 68 */ sceneEvent(QEvent *)69 bool sceneEvent ( QEvent * ) override {return false;} 70 71 private: 72 const GameLogic::ONU* m_theWorld; 73 bool m_bgIsArena; 74 }; 75 } 76 #endif // BACKGND_H 77 78