Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 9057 was 9008, checked in by bensch, 18 years ago

orxonox/trunk: merged the network bak to the trunk
merged with command:
svn merge -r8804:HEAD https://svn.orxonox.net/orxonox/branches/multi_player_map .

conflicts all resolved in favour of the branche

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