Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 7476 was 7461, checked in by patrick, 19 years ago

orxonox: the mission goal framework is nearly completed

File size: 1.2 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;
[7017]18
19
20class 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);
[7461]28    void loadMissionGoal(const TiXmlElement* root = NULL);
[7020]29
30
[7400]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
[7044]35    virtual void onPlayerSpawn() {}
36    virtual void onPlayerDeath() {}
[7034]37
38
[7020]39    virtual void tick(float dt) = 0;
[7034]40    /** draws the stuff from the game rules if there is any need to */
41    void draw() {}
[7020]42
43
[7034]44  protected:
45    virtual void checkGameRules() {}
46
47
48  protected:
[7400]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
[7020]52};
[7017]53
[7020]54
55#endif /* _GAME_RULES_H */
Note: See TracBrowser for help on using the repository browser.