Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/util/multiplayer_team_deathmatch.cc @ 7037

Last change on this file since 7037 was 7037, checked in by patrick, 18 years ago

trunk: game rules definitions added

File size: 2.0 KB
Line 
1/*
2   orxonox - the future of 3D-vertical-scrollers
3
4   Copyright (C) 2004 orx
5
6   This program is free software; you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2, or (at your option)
9   any later version.
10
11### File Specific:
12   main-programmer: Patrick Boenzli
13*/
14
15#define DEBUG_MODULE_GAME_RULES
16
17#include "multiplayer_team_deathmatch.h"
18
19#include "load_param.h"
20#include "factory.h"
21
22
23using namespace std;
24
25
26CREATE_FACTORY(MultiplayerTeamDeathmatch, CL_MULTIPLAYER_TEAM_DEATHMATCH);
27
28
29/**
30 * constructor
31 */
32MultiplayerTeamDeathmatch::MultiplayerTeamDeathmatch(const TiXmlElement* root)
33  : GameRules(root)
34{
35  this->setClassID(CL_MULTIPLAYER_TEAM_DEATHMATCH, "MultiplayerTeamDeathmatch");
36
37  this->bLocalPlayerDead = false;
38  this->deathTimeout = 10.0f;     // 5 seconds
39
40  if( root != NULL)
41    this->loadParams(root);
42}
43
44/**
45 * decontsructor
46 */
47MultiplayerTeamDeathmatch::~MultiplayerTeamDeathmatch()
48{}
49
50
51
52void MultiplayerTeamDeathmatch::loadParams(const TiXmlElement* root)
53{
54  GameRules::loadParams(root);
55
56  LoadParam(root, "death-penalty-timeout", this, MultiplayerTeamDeathmatch, setDeathPenaltyTimeout)
57      .describe("sets the time in seconds a player has to wait for respawn");
58
59  LoadParam(root, "max-kills", this, MultiplayerTeamDeathmatch, setMaxKills)
60      .describe("sets the maximal kills for winning condition");
61}
62
63
64/**
65 * called when the player enters the game
66 * @param player the spawned player
67 */
68void MultiplayerTeamDeathmatch::onPlayerSpawn(Player* player)
69{}
70
71
72/**
73 * when the player is killed
74 * @param player the killed player
75 */
76void MultiplayerTeamDeathmatch::onPlayerDeath(Player* player)
77{}
78
79
80/**
81 * time tick
82 * @param dt time
83 */
84void MultiplayerTeamDeathmatch::tick(float dt)
85{
86
87}
88
89
90/**
91 * draws the stuff
92 */
93void MultiplayerTeamDeathmatch::draw()
94{}
95
96
97/**
98 * check the game rules for consistency
99 */
100void MultiplayerTeamDeathmatch::checkGameRules()
101{}
102
103
104
105
106
107
Note: See TracBrowser for help on using the repository browser.