Orxonox  0.0.5 Codename: Arcturus
Highscore.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  * kappenh
24  * Co-authors:
25  * ...
26  *
27  */
28 
29 #ifndef _Highscore_H__
30 #define _Highscore_H__
31 
32 #include <string>
33 #include <vector>
34 
35 #include "OrxonoxPrereqs.h"
37 #include "util/Singleton.h"
38 
39 // tolua_begin
40 namespace orxonox
41 {
43  // tolua_end
44  : public Singleton<Highscore>, public Configurable
45  { //tolua_export
46  friend class Singleton<Highscore>;
47  public:
48  Highscore(); // Constructor
49  void setConfigValues(); // Inherited function
50 
51  bool storeScore(const std::string& level, int points, PlayerInfo* player);
52  int getHighestScoreOfGame(const std::string& game);
53 
54  // tolua_begin
55  inline unsigned int getNumberOfHighscores()
56  { return this->highscores_.size(); }
57  inline const std::string& getHighscore(unsigned int index)
58  { return this->highscores_[index]; }
59 
62  // tolua_end
63 
64  private:
65  std::vector<std::string> highscores_;
67  }; //tolua_export
68 
69 } //tolua_export
70 
71 #endif /* _Highscore_H__ */
static Highscore * singletonPtr_s
Definition: Highscore.h:66
static Highscore & getInstance()
Definition: Highscore.h:60
::std::string string
Definition: gtest-port.h:756
Definition: Highscore.h:42
This is the base class of all objects which may contain config values.
Definition: Configurable.h:47
unsigned int getNumberOfHighscores()
Definition: Highscore.h:55
Base for singleton classes.
Definition: Singleton.h:114
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
Shared library macros, enums, constants and forward declarations for the orxonox library ...
const std::string & getHighscore(unsigned int index)
Definition: Highscore.h:57
Declaration of Configurable, the base class of all objects which may contain config values...
#define _OrxonoxExport
Definition: OrxonoxPrereqs.h:60
Definition of the Singleton template that is used as base class for classes that allow only one insta...
Definition: PlayerInfo.h:39
std::vector< std::string > highscores_
Definition: Highscore.h:65
static T & getInstance()
Returns a reference to the singleton instance.
Definition: Singleton.h:118