Last change
on this file since 8937 was
8802,
checked in by patrick, 18 years ago
|
merged the network branche back to trunk
|
File size:
1.5 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 | |
---|
[7483] | 13 | #include "kill.h" |
---|
[7017] | 14 | |
---|
[7020] | 15 | class TiXmlElement; |
---|
| 16 | class ObjectManager; |
---|
[7034] | 17 | class Player; |
---|
[7400] | 18 | class MissionGoal; |
---|
[7482] | 19 | class Kill; |
---|
[7017] | 20 | |
---|
| 21 | |
---|
[8623] | 22 | class GameRules : virtual public BaseObject |
---|
[7017] | 23 | { |
---|
| 24 | |
---|
| 25 | public: |
---|
[7035] | 26 | GameRules(const TiXmlElement* root); |
---|
[7017] | 27 | virtual ~GameRules(); |
---|
| 28 | |
---|
[7035] | 29 | virtual void loadParams(const TiXmlElement* root = NULL); |
---|
[7461] | 30 | void loadMissionGoal(const TiXmlElement* root = NULL); |
---|
[7020] | 31 | |
---|
| 32 | |
---|
[7400] | 33 | /** adding an mission goal to the game rules @param missionGoal the mission goal to add */ |
---|
| 34 | inline void addMissionGoal(MissionGoal* missionGoal) { this->missionList.push_back(missionGoal); } |
---|
[7486] | 35 | /** adding a kill event to the kill list @param kill the kill object containing all infos */ |
---|
[8362] | 36 | void registerKill(const Kill& kill); |
---|
[8802] | 37 | virtual void registerSpawn( WorldEntity * we ){} |
---|
[7400] | 38 | |
---|
[7044] | 39 | virtual void onPlayerSpawn() {} |
---|
| 40 | virtual void onPlayerDeath() {} |
---|
[7034] | 41 | |
---|
[7020] | 42 | virtual void tick(float dt) = 0; |
---|
[7034] | 43 | /** draws the stuff from the game rules if there is any need to */ |
---|
| 44 | void draw() {} |
---|
[7020] | 45 | |
---|
| 46 | |
---|
[7034] | 47 | protected: |
---|
| 48 | virtual void checkGameRules() {} |
---|
| 49 | |
---|
| 50 | |
---|
| 51 | protected: |
---|
[7400] | 52 | ObjectManager* pObjectManager; //!< reference to the current Object Manager |
---|
| 53 | Player* localPlayer; //!< reference to the local player |
---|
| 54 | std::vector<MissionGoal*> missionList; //!< list of mission goals |
---|
[7482] | 55 | |
---|
[7486] | 56 | std::vector<Kill> killList; //!< list of kills in the world |
---|
[7020] | 57 | }; |
---|
[7017] | 58 | |
---|
[7020] | 59 | |
---|
| 60 | #endif /* _GAME_RULES_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.