Orxonox  0.0.5 Codename: Arcturus
PongScore.h
Go to the documentation of this file.
1 /*
2  * ORXONOX - the hottest 3D action shooter ever to exist
3  * > www.orxonox.net <
4  *
5  *
6  * License notice:
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  *
22  * Author:
23  * Fabian 'x3n' Landau
24  * Co-authors:
25  * ...
26  *
27  */
28 
35 #ifndef _PongScore_H__
36 #define _PongScore_H__
37 
38 #include "pong/PongPrereqs.h"
39 
41 
42 #include "overlays/OverlayText.h"
43 
44 namespace orxonox
45 {
46 
56  class _PongExport PongScore : public OverlayText, public Tickable
57  {
58  public:
59  PongScore(Context* context);
60  virtual ~PongScore();
61 
62  virtual void tick(float dt) override;
63  virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
64  virtual void changedOwner() override;
65 
70  inline void setShowName(bool value)
71  { this->bShowName_ = value; }
76  inline bool getShowName() const
77  { return this->bShowName_; }
78 
83  inline void setShowScore(bool value)
84  { this->bShowScore_ = value; }
89  inline bool getShowScore() const
90  { return this->bShowScore_; }
91 
96  inline void setShowLeftPlayer(bool value)
97  { this->bShowLeftPlayer_ = value; }
102  inline bool getShowLeftPlayer() const
103  { return this->bShowLeftPlayer_; }
104 
109  inline void setShowRightPlayer(bool value)
110  { this->bShowRightPlayer_ = value; }
115  inline bool getShowRightPlayer() const
116  { return this->bShowRightPlayer_; }
117 
118  private:
120  bool bShowName_;
121  bool bShowScore_;
127 
128  };
129 }
130 #endif /* _PongScore_H__ */
Definition: OverlayText.h:41
Declaration of the Tickable interface.
The WorldSound class is to be used for sounds with position and orientation.
Definition: WorldSound.h:44
void setShowName(bool value)
Set whether the PongScore displays the players&#39; names.
Definition: PongScore.h:70
void setShowRightPlayer(bool value)
Set whether the PongScore displays the right player.
Definition: PongScore.h:109
void setShowScore(bool value)
Set whether the PongScore displays the players&#39; scores.
Definition: PongScore.h:83
WeakPtr wraps a pointer to an object, which becomes nullptr if the object is deleted.
Definition: CorePrereqs.h:236
bool bShowRightPlayer_
Whether the right player is shown.
Definition: PongScore.h:123
void setShowLeftPlayer(bool value)
Set whether the PongScore displays the left player.
Definition: PongScore.h:96
xmlelement
Definition: Super.h:519
bool getShowScore() const
Get whether the PongScore displays the players&#39; scores.
Definition: PongScore.h:89
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
Implements a Pong minigame (Wikipedia::Pong).
Definition: Pong.h:64
The PongScore class displays the score for a game of Pong.
Definition: PongScore.h:56
Mode
Definition: CorePrereqs.h:102
WeakPtr< PlayerInfo > player1_
Store information about left player permanently.
Definition: PongScore.h:124
bool getShowName() const
Get whether the PongScore displays the players&#39; names.
Definition: PongScore.h:76
Definition: Context.h:45
bool bShowLeftPlayer_
Whether the left player is shown.
Definition: PongScore.h:122
bool bShowScore_
Whether the score of the players is shown.
Definition: PongScore.h:121
WorldSound * scoreSound_
Definition: PongScore.h:126
bool bShowName_
Whether the names of the players are shown.
Definition: PongScore.h:120
bool getShowLeftPlayer() const
Get whether the PongScore displays the left player.
Definition: PongScore.h:102
bool getShowRightPlayer() const
Get whether the PongScore displays the right player.
Definition: PongScore.h:115
WeakPtr< PlayerInfo > player2_
Same for the right player. To end the game properly.
Definition: PongScore.h:125
#define _PongExport
Definition: PongPrereqs.h:60
Shared library macros, enums, constants and forward declarations for the pong module ...
The Tickable interface provides a tick(dt) function, that gets called every frame.
Definition: Tickable.h:52
Pong * owner_
The Pong game that owns this PongScore.
Definition: PongScore.h:119