Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 7482 was 7482, checked in by patrick, 18 years ago

orxonox: working on kill event processing (game rule specific)

File size: 1.4 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;
18class Kill;
19
20
21class GameRules : public BaseObject
22{
23
24  public:
25    GameRules(const TiXmlElement* root);
26    virtual ~GameRules();
27
28    virtual void loadParams(const TiXmlElement* root = NULL);
29    void loadMissionGoal(const TiXmlElement* root = NULL);
30
31
32    /** adding an mission goal to the game rules @param missionGoal the mission goal to add */
33    inline void addMissionGoal(MissionGoal* missionGoal) { this->missionList.push_back(missionGoal); }
34
35    inline void registerKill(const Kill& kill) { /*this->killList.push_back(&kill);*/ }
36
37    virtual void onPlayerSpawn() {}
38    virtual void onPlayerDeath() {}
39
40
41    virtual void tick(float dt) = 0;
42    /** draws the stuff from the game rules if there is any need to */
43    void draw() {}
44
45
46  protected:
47    virtual void checkGameRules() {}
48
49
50  protected:
51    ObjectManager*              pObjectManager;         //!< reference to the current Object Manager
52    Player*                     localPlayer;            //!< reference to the local player
53    std::vector<MissionGoal*>   missionList;            //!< list of mission goals
54
55    const std::vector<Kill*>          killList;               //!<  list of kills in the world
56};
57
58
59#endif /* _GAME_RULES_H */
Note: See TracBrowser for help on using the repository browser.