source:
orxonox.OLD/trunk/src/util/game_rules.h
@
7132
Last change on this file since 7132 was 7044, checked in by patrick, 19 years ago | |
---|---|
File size: 860 bytes |
Rev | Line | |
---|---|---|
[7017] | 1 | |
2 | /*! | |
3 | * @file game_rules.h | |
4 | * Defines game rules for this game | |
5 | */ | |
6 | ||
7 | #ifndef _GAME_RULES_H | |
8 | #define _GAME_RULES_H | |
9 | ||
10 | #include "base_object.h" | |
11 | ||
12 | ||
[7020] | 13 | class TiXmlElement; |
14 | class ObjectManager; | |
[7034] | 15 | class Player; |
[7017] | 16 | |
17 | ||
18 | class GameRules : public BaseObject | |
19 | { | |
20 | ||
21 | public: | |
[7035] | 22 | GameRules(const TiXmlElement* root); |
[7017] | 23 | virtual ~GameRules(); |
24 | ||
[7035] | 25 | virtual void loadParams(const TiXmlElement* root = NULL); |
[7020] | 26 | |
27 | ||
[7044] | 28 | virtual void onPlayerSpawn() {} |
29 | virtual void onPlayerDeath() {} | |
[7034] | 30 | |
31 | ||
[7020] | 32 | virtual void tick(float dt) = 0; |
[7034] | 33 | /** draws the stuff from the game rules if there is any need to */ |
34 | void draw() {} | |
[7020] | 35 | |
36 | ||
[7034] | 37 | protected: |
38 | virtual void checkGameRules() {} | |
39 | ||
40 | ||
41 | protected: | |
[7020] | 42 | ObjectManager* pObjectManager; //!< reference to the current Object Manager |
[7034] | 43 | Player* localPlayer; //!< reference to the local player |
[7020] | 44 | }; |
[7017] | 45 | |
[7020] | 46 | |
47 | #endif /* _GAME_RULES_H */ |
Note: See TracBrowser
for help on using the repository browser.