Orxonox  0.0.5 Codename: Arcturus
SOB.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  * Julien Kindle
24  * Co-authors:
25  *
26  *
27  */
28 
34 #ifndef _SOB_H__
35 #define _SOB_H__
36 
38 #include "gametypes/Deathmatch.h"
39 #include "SOBCenterpoint.h"
40 
41 namespace orxonox
42 {
43 
44  class _SOBExport SOB : public Deathmatch
45  {
46  public:
47  SOB(Context* context);
48  virtual ~SOB();
49  virtual void tick(float dt) override;
50 
51 
53  { this->center_ = center; }
54  virtual void start() override;
55  virtual void end() override;
56  virtual void spawnPlayer(PlayerInfo* player) override;
57  PlayerInfo* getPlayer() const;
58 
59  void restart();
60 
61  //Functions for points and coins
62  int getPoints() {
63  return points_;
64  }
65  int getCoins() {
66  return coins_;
67  }
68  void addCoin() {
69  ++coins_;
70  points_+=200;
71  }
72  void addMushroom() {
73  points_+=1000;
74  }
75  void addGumba() {
76  points_+=100;
77  }
78  void addGumbaBoss() {
79  points_+=5000;
80  }
81  void addPoints(int poi) {
82  points_+=poi;
83  }
84  int getTimeLeft() {
85  return (int) timeLeft_;
86  }
88  return info_;
89  }
90  void setDone(bool tr) {
91  done_ = tr;
92  }
93 
94 
95  //Not used yet - placed if somebody wants to develop lvl 1-2 etc
96  void setLvl(int lvl) {
97  lvl_ = lvl;
98  }
99  int getLvl() {
100  return lvl_;
101  }
102  virtual void playerEntered(PlayerInfo* player) override
103  {
104  Gametype::playerEntered(player);
105  }
106 
109 
110  protected:
111 
112 
114  int points_;
115  int coins_;
116  float timeLeft_;
117  bool done_;
118  int lvl_;
120 
121 
122  };
123  }
124 
125 #endif /* _SOB_H__ */
#define _SOBExport
Definition: SOBPrereqs.h:60
int getLvl()
Definition: SOB.h:99
int getPoints()
Definition: SOB.h:62
int coins_
Definition: SOB.h:115
::std::string string
Definition: gtest-port.h:756
virtual void playerEntered(PlayerInfo *player)
Definition: Gametype.cc:195
void setDone(bool tr)
Definition: SOB.h:90
void addGumbaBoss()
Definition: SOB.h:78
bool done_
Definition: SOB.h:117
std::string getInfoText()
Definition: SOB.h:87
WeakPtr wraps a pointer to an object, which becomes nullptr if the object is deleted.
Definition: CorePrereqs.h:236
float timeLeft_
Definition: SOB.h:116
void addMushroom()
Definition: SOB.h:72
virtual void playerEntered(PlayerInfo *player) override
Definition: SOB.h:102
WeakPtr< SOBFigure > figure_
Definition: SOB.h:113
int lvl_
Definition: SOB.h:118
void addGumba()
Definition: SOB.h:75
void addCoin()
Definition: SOB.h:68
int points_
Definition: SOB.h:114
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
void addPoints(int poi)
Definition: SOB.h:81
Definition: Context.h:45
std::string info_
Definition: SOB.h:119
WeakPtr< SOBCenterpoint > center_
Definition: SOB.h:107
int getTimeLeft()
Definition: SOB.h:84
Definition: Deathmatch.h:37
Definition: PlayerInfo.h:39
void setCenterpoint(SOBCenterpoint *center)
Definition: SOB.h:52
The SOBCenterpoint is a StaticEntity which represents the level of the minigame.
Definition: SOBCenterpoint.h:42
Definition: SOB.h:44
int getCoins()
Definition: SOB.h:65
bool newHighscore
Definition: SOB.h:108
Shared library macros, enums, constants and forward declarations for the SOB module ...
void setLvl(int lvl)
Definition: SOB.h:96