/*! * @file multiplayer_team_deathmatch.h * Defines game rules for team deathmatch games * * currently there are only two teams supported */ #ifndef _MULTIPLAYER_TEAM_DEATHMATCH_H #define _MULTIPLAYER_TEAM_DEATHMATCH_H #include "game_rules.h" class TiXmlElement; class ObjectManager; class Player; class MultiplayerTeamDeathmatch : public GameRules { public: MultiplayerTeamDeathmatch(const TiXmlElement* root = NULL); virtual ~MultiplayerTeamDeathmatch(); virtual void loadParams(const TiXmlElement* root); virtual void onPlayerSpawn(Player* player); virtual void onPlayerDeath(Player* player); virtual void tick(float dt); void draw(); inline void setDeathPenaltyTimeout(float time) { this->deathTimeout = time; } inline void setMaxKills(int kills) { this->maxKills = kills; } protected: virtual void checkGameRules(); private: bool bLocalPlayerDead; //!< true if the local player is dead float deathTimeout; //!< timeout a player cannot play if he/she dies int maxKills; //!< max kills for winning condition int teamAKills; //!< kills of team A int teamBKills; //!< kills of team B }; #endif /* _MULTIPLAYER_TEAM_DEATHMATCH_H */