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