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
RevLine 
[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]14class TiXmlElement;
15class ObjectManager;
[7034]16class Player;
[7400]17class MissionGoal;
[7482]18class Kill;
[7017]19
20
21class GameRules : public BaseObject
22{
23
24  public:
[7035]25    GameRules(const TiXmlElement* root);
[7017]26    virtual ~GameRules();
27
[7035]28    virtual void loadParams(const TiXmlElement* root = NULL);
[7461]29    void loadMissionGoal(const TiXmlElement* root = NULL);
[7020]30
31
[7400]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
[7482]35    inline void registerKill(const Kill& kill) { /*this->killList.push_back(&kill);*/ }
[7400]36
[7044]37    virtual void onPlayerSpawn() {}
38    virtual void onPlayerDeath() {}
[7034]39
40
[7020]41    virtual void tick(float dt) = 0;
[7034]42    /** draws the stuff from the game rules if there is any need to */
43    void draw() {}
[7020]44
45
[7034]46  protected:
47    virtual void checkGameRules() {}
48
49
50  protected:
[7400]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
[7482]54
55    const std::vector<Kill*>          killList;               //!<  list of kills in the world
[7020]56};
[7017]57
[7020]58
59#endif /* _GAME_RULES_H */
Note: See TracBrowser for help on using the repository browser.