|
Last change
on this file since 7037 was
7037,
checked in by patrick, 20 years ago
|
|
trunk: game rules definitions added
|
|
File size:
1.3 KB
|
| Line | |
|---|
| 1 | |
|---|
| 2 | /*! |
|---|
| 3 | * @file multiplayer_team_deathmatch.h |
|---|
| 4 | * Defines game rules for team deathmatch games |
|---|
| 5 | * |
|---|
| 6 | * currently there are only two teams supported |
|---|
| 7 | */ |
|---|
| 8 | |
|---|
| 9 | #ifndef _MULTIPLAYER_TEAM_DEATHMATCH_H |
|---|
| 10 | #define _MULTIPLAYER_TEAM_DEATHMATCH_H |
|---|
| 11 | |
|---|
| 12 | #include "game_rules.h" |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | class TiXmlElement; |
|---|
| 16 | class ObjectManager; |
|---|
| 17 | class Player; |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | class MultiplayerTeamDeathmatch : public GameRules |
|---|
| 21 | { |
|---|
| 22 | |
|---|
| 23 | public: |
|---|
| 24 | MultiplayerTeamDeathmatch(const TiXmlElement* root = NULL); |
|---|
| 25 | virtual ~MultiplayerTeamDeathmatch(); |
|---|
| 26 | |
|---|
| 27 | virtual void loadParams(const TiXmlElement* root); |
|---|
| 28 | |
|---|
| 29 | |
|---|
| 30 | virtual void onPlayerSpawn(Player* player); |
|---|
| 31 | virtual void onPlayerDeath(Player* player); |
|---|
| 32 | |
|---|
| 33 | |
|---|
| 34 | virtual void tick(float dt); |
|---|
| 35 | void draw(); |
|---|
| 36 | |
|---|
| 37 | inline void setDeathPenaltyTimeout(float time) { this->deathTimeout = time; } |
|---|
| 38 | inline void setMaxKills(int kills) { this->maxKills = kills; } |
|---|
| 39 | |
|---|
| 40 | protected: |
|---|
| 41 | virtual void checkGameRules(); |
|---|
| 42 | |
|---|
| 43 | private: |
|---|
| 44 | bool bLocalPlayerDead; //!< true if the local player is dead |
|---|
| 45 | float deathTimeout; //!< timeout a player cannot play if he/she dies |
|---|
| 46 | int maxKills; //!< max kills for winning condition |
|---|
| 47 | |
|---|
| 48 | int teamAKills; //!< kills of team A |
|---|
| 49 | int teamBKills; //!< kills of team B |
|---|
| 50 | }; |
|---|
| 51 | |
|---|
| 52 | |
|---|
| 53 | #endif /* _MULTIPLAYER_TEAM_DEATHMATCH_H */ |
|---|
Note: See
TracBrowser
for help on using the repository browser.