• 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
infosidebar.h
Go to the documentation of this file.
1 /*
2  * Copyright 2009 Mathias Kraus <k.hias@gmx.de>
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; either version 2 of
7  * the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef INFOSIDEBAR_H
19 #define INFOSIDEBAR_H
20 
21 #include "granatierglobals.h"
22 
23 #include <QObject>
24 #include <QMap>
25 #include <QList>
26 
27 class QGraphicsScene;
28 class QGraphicsTextItem;
29 class QGraphicsRectItem;
30 class Game;
31 class GameScene;
32 class Player;
33 class QRectF;
34 class KGameRenderedItem;
35 
36 struct PlayerInfo
37 {
38  QGraphicsTextItem* name;
39  KGameRenderedItem* icon;
40  KGameRenderedItem* bonusShield;
41  QGraphicsRectItem* bonusShieldDimm;
42  KGameRenderedItem* bonusThrow;
43  QGraphicsRectItem* bonusThrowDimm;
44  KGameRenderedItem* bonusKick;
45  QGraphicsRectItem* bonusKickDimm;
46  KGameRenderedItem* badBonus;
47  QGraphicsRectItem* badBonusDimm;
48 };
49 
53 class InfoSidebar : public QObject
54 {
55 
56  Q_OBJECT
57 
58 private:
59  GameScene* m_gameScene;
60  Game* m_game;
61 
62  QMap<Player*, PlayerInfo*> m_mapPlayerInfo;
63 
64  QGraphicsRectItem* m_background;
65 
66  qreal m_svgScaleFactor;
67 
68  QString m_badBonusSpriteKey;
69 
70 public:
71 
78  InfoSidebar (Game* p_game, GameScene* p_scene);
79 
83  virtual ~InfoSidebar();
84 
88  void reset();
89 
93  QRectF rect();
94 
98  void themeChanged();
99 
100 private slots:
107  void bonusInfoChanged(Player* player, Granatier::Bonus::Type bonusType, int percentageElapsed);
108 
109 public slots:
114  virtual void updateGraphics(qreal svgScaleFactor);
115 };
116 
117 #endif
118 
PlayerInfo::icon
KGameRenderedItem * icon
Definition: infosidebar.h:39
QGraphicsScene
InfoSidebar::reset
void reset()
Resets the player states.
Definition: infosidebar.cpp:266
PlayerInfo::badBonusDimm
QGraphicsRectItem * badBonusDimm
Definition: infosidebar.h:47
QMap< Player *, PlayerInfo * >
PlayerInfo::bonusKick
KGameRenderedItem * bonusKick
Definition: infosidebar.h:44
InfoSidebar::InfoSidebar
InfoSidebar(Game *p_game, GameScene *p_scene)
Creates a new InfoSidebar instance.
Definition: infosidebar.cpp:32
PlayerInfo
Definition: infosidebar.h:36
PlayerInfo::bonusThrowDimm
QGraphicsRectItem * bonusThrowDimm
Definition: infosidebar.h:43
PlayerInfo::bonusThrow
KGameRenderedItem * bonusThrow
Definition: infosidebar.h:42
PlayerInfo::badBonus
KGameRenderedItem * badBonus
Definition: infosidebar.h:46
QObject
Game
This class manages the game main loop : it regularly checks the key press events, computes the charac...
Definition: game.h:43
granatierglobals.h
QGraphicsTextItem
InfoSidebar::~InfoSidebar
virtual ~InfoSidebar()
Deletes the InfoSidebar instance.
Definition: infosidebar.cpp:181
QString
PlayerInfo::name
QGraphicsTextItem * name
Definition: infosidebar.h:38
InfoSidebar::updateGraphics
virtual void updateGraphics(qreal svgScaleFactor)
Updates the graphics after a resize.
Definition: infosidebar.cpp:434
QGraphicsRectItem
QRectF
InfoSidebar::rect
QRectF rect()
Returns the background rect of the infoSidebar.
Definition: infosidebar.cpp:278
GameScene
This class contains all the Game elements to be drawn on the screen by the GameView instance...
Definition: gamescene.h:50
KGameRenderedItem
PlayerInfo::bonusShieldDimm
QGraphicsRectItem * bonusShieldDimm
Definition: infosidebar.h:41
PlayerInfo::bonusShield
KGameRenderedItem * bonusShield
Definition: infosidebar.h:40
InfoSidebar
This class represents the game sidebar with game information about the player.
Definition: infosidebar.h:53
InfoSidebar::themeChanged
void themeChanged()
Handles theme changes.
Definition: infosidebar.cpp:283
Player
This class represents the main character of the game.
Definition: player.h:33
PlayerInfo::bonusKickDimm
QGraphicsRectItem * bonusKickDimm
Definition: infosidebar.h:45
Granatier::Bonus::Type
Type
Definition: granatierglobals.h:103
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