|
Last change
on this file since 7473 was
7461,
checked in by patrick, 20 years ago
|
|
orxonox: the mission goal framework is nearly completed
|
|
File size:
1.2 KB
|
| Line | |
|---|
| 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 | #include <vector> |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | class TiXmlElement; |
|---|
| 15 | class ObjectManager; |
|---|
| 16 | class Player; |
|---|
| 17 | class MissionGoal; |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | class GameRules : public BaseObject |
|---|
| 21 | { |
|---|
| 22 | |
|---|
| 23 | public: |
|---|
| 24 | GameRules(const TiXmlElement* root); |
|---|
| 25 | virtual ~GameRules(); |
|---|
| 26 | |
|---|
| 27 | virtual void loadParams(const TiXmlElement* root = NULL); |
|---|
| 28 | void loadMissionGoal(const TiXmlElement* root = NULL); |
|---|
| 29 | |
|---|
| 30 | |
|---|
| 31 | /** adding an mission goal to the game rules @param missionGoal the mission goal to add */ |
|---|
| 32 | inline void addMissionGoal(MissionGoal* missionGoal) { this->missionList.push_back(missionGoal); } |
|---|
| 33 | |
|---|
| 34 | |
|---|
| 35 | virtual void onPlayerSpawn() {} |
|---|
| 36 | virtual void onPlayerDeath() {} |
|---|
| 37 | |
|---|
| 38 | |
|---|
| 39 | virtual void tick(float dt) = 0; |
|---|
| 40 | /** draws the stuff from the game rules if there is any need to */ |
|---|
| 41 | void draw() {} |
|---|
| 42 | |
|---|
| 43 | |
|---|
| 44 | protected: |
|---|
| 45 | virtual void checkGameRules() {} |
|---|
| 46 | |
|---|
| 47 | |
|---|
| 48 | protected: |
|---|
| 49 | ObjectManager* pObjectManager; //!< reference to the current Object Manager |
|---|
| 50 | Player* localPlayer; //!< reference to the local player |
|---|
| 51 | std::vector<MissionGoal*> missionList; //!< list of mission goals |
|---|
| 52 | }; |
|---|
| 53 | |
|---|
| 54 | |
|---|
| 55 | #endif /* _GAME_RULES_H */ |
|---|
Note: See
TracBrowser
for help on using the repository browser.