| 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 |  | 
|---|
| 29 | /** | 
|---|
| 30 |     @file SOB.h | 
|---|
| 31 |     @brief Declaration of the SOB class. | 
|---|
| 32 | */ | 
|---|
| 33 |  | 
|---|
| 34 | #ifndef _SOB_H__ | 
|---|
| 35 | #define _SOB_H__ | 
|---|
| 36 |  | 
|---|
| 37 | #include "superorxobros/SOBPrereqs.h" | 
|---|
| 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); //!< Constructor. Registers and initializes the object. | 
|---|
| 48 |             virtual ~SOB(); //!< Destructor. Cleans up, if initialized. | 
|---|
| 49 |             virtual void tick(float dt) override; | 
|---|
| 50 |  | 
|---|
| 51 |  | 
|---|
| 52 |             void setCenterpoint(SOBCenterpoint* center) | 
|---|
| 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 addPoints(int poi) { | 
|---|
| 79 |                 points_+=poi; | 
|---|
| 80 |             } | 
|---|
| 81 |             int getTimeLeft() { | 
|---|
| 82 |                 return timeLeft_; | 
|---|
| 83 |             } | 
|---|
| 84 |             std::string getInfoText() { | 
|---|
| 85 |                 return info_; | 
|---|
| 86 |             }     | 
|---|
| 87 |             void setDone(bool tr) { | 
|---|
| 88 |                 done_ = tr; | 
|---|
| 89 |             } | 
|---|
| 90 |  | 
|---|
| 91 |  | 
|---|
| 92 |             //Not used yet - placed if somebody wants to develop lvl 1-2 etc | 
|---|
| 93 |             void setLvl(int lvl) { | 
|---|
| 94 |                 lvl_ = lvl; | 
|---|
| 95 |             } | 
|---|
| 96 |             int getLvl() { | 
|---|
| 97 |                 return lvl_; | 
|---|
| 98 |             } | 
|---|
| 99 |             virtual void playerEntered(PlayerInfo* player) override | 
|---|
| 100 |             { | 
|---|
| 101 |                 Gametype::playerEntered(player); | 
|---|
| 102 |             }   | 
|---|
| 103 |  | 
|---|
| 104 |             WeakPtr<SOBCenterpoint> center_; | 
|---|
| 105 |  | 
|---|
| 106 |         protected: | 
|---|
| 107 |  | 
|---|
| 108 |  | 
|---|
| 109 |             void cleanup(); //!< Cleans up the Gametype  | 
|---|
| 110 |             WeakPtr<SOBFigure> figure_; | 
|---|
| 111 |             WeakPtr<Camera> camera; | 
|---|
| 112 |             int points_; | 
|---|
| 113 |             int coins_; | 
|---|
| 114 |             float timeLeft_; | 
|---|
| 115 |             bool done_; | 
|---|
| 116 |             int lvl_; | 
|---|
| 117 |             std::string info_; | 
|---|
| 118 |  | 
|---|
| 119 |  | 
|---|
| 120 |         }; | 
|---|
| 121 |     } | 
|---|
| 122 |  | 
|---|
| 123 | #endif /* _SOB_H__ */ | 
|---|