Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/util/game_rules.h @ 7478

Last change on this file since 7478 was 7461, checked in by patrick, 19 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
14class TiXmlElement;
15class ObjectManager;
16class Player;
17class MissionGoal;
18
19
20class 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.