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 | |
---|
29 | /** |
---|
30 | @file Pong.h |
---|
31 | @brief Declaration of the Pong class. |
---|
32 | @ingroup Pong |
---|
33 | */ |
---|
34 | |
---|
35 | #ifndef _SOB_H__ |
---|
36 | #define _SOB_H__ |
---|
37 | |
---|
38 | #include "superorxobros/SOBPrereqs.h" |
---|
39 | |
---|
40 | #include "tools/Timer.h" |
---|
41 | |
---|
42 | #include "gametypes/Deathmatch.h" |
---|
43 | #include "SOBCenterpoint.h" |
---|
44 | |
---|
45 | namespace orxonox |
---|
46 | { |
---|
47 | |
---|
48 | |
---|
49 | class _SOBExport SOB : public Deathmatch |
---|
50 | { |
---|
51 | public: |
---|
52 | SOB(Context* context); //!< Constructor. Registers and initializes the object. |
---|
53 | virtual ~SOB(); //!< Destructor. Cleans up, if initialized. |
---|
54 | virtual void tick(float dt) override; |
---|
55 | |
---|
56 | |
---|
57 | void setCenterpoint(SOBCenterpoint* center) |
---|
58 | { this->center_ = center; } |
---|
59 | virtual void start() override; |
---|
60 | virtual void end() override; |
---|
61 | virtual void spawnPlayer(PlayerInfo* player) override; |
---|
62 | PlayerInfo* getPlayer() const; |
---|
63 | |
---|
64 | void restart(); |
---|
65 | int getPoints() { |
---|
66 | return points_; |
---|
67 | } |
---|
68 | int getCoins() { |
---|
69 | return coins_; |
---|
70 | } |
---|
71 | void addCoin() { |
---|
72 | ++coins_; |
---|
73 | points_+=200; |
---|
74 | } |
---|
75 | void addMushroom() { |
---|
76 | points_+=1000; |
---|
77 | } |
---|
78 | void addGumba() { |
---|
79 | points_+=100; |
---|
80 | } |
---|
81 | int getTimeLeft() { |
---|
82 | return timeLeft_; |
---|
83 | } |
---|
84 | std::string getInfoText() { |
---|
85 | return info_; |
---|
86 | } |
---|
87 | |
---|
88 | void setLvl(int lvl) { |
---|
89 | lvl_ = lvl; |
---|
90 | } |
---|
91 | int getLvl() { |
---|
92 | return lvl_; |
---|
93 | } |
---|
94 | virtual void playerEntered(PlayerInfo* player) override |
---|
95 | { |
---|
96 | Gametype::playerEntered(player); |
---|
97 | } |
---|
98 | |
---|
99 | |
---|
100 | WeakPtr<SOBCenterpoint> center_; |
---|
101 | |
---|
102 | protected: |
---|
103 | |
---|
104 | |
---|
105 | void cleanup(); //!< Cleans up the Gametype |
---|
106 | WeakPtr<SOBFigure> figure_; |
---|
107 | WeakPtr<Camera> camera; |
---|
108 | int points_; |
---|
109 | int coins_; |
---|
110 | float timeLeft_; |
---|
111 | |
---|
112 | int lvl_; |
---|
113 | std::string info_; |
---|
114 | |
---|
115 | |
---|
116 | }; |
---|
117 | } |
---|
118 | |
---|
119 | #endif /* _Pong_H__ */ |
---|