Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/captureTheFlag/src/modules/gametypes/captureTheFlag.h @ 9218

Last change on this file since 9218 was 9218, checked in by ninow, 12 years ago

Forgot to add Files

File size: 2.8 KB
Line 
1/*
2 *   ORXONOX - the hottest 3D action shooter ever to exist
3 *                    > www.orxonox.net <
4 *
5 *
6 *   License notice:
7 *
8 *   This program is free software; you can redistribute it and/or
9 *   modify it under the terms of the GNU General Public License
10 *   as published by the Free Software Foundation; either version 2
11 *   of the License, or (at your option) any later version.
12 *
13 *   This program is distributed in the hope that it will be useful,
14 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 *   GNU General Public License for more details.
17 *
18 *   You should have received a copy of the GNU General Public License
19 *   along with this program; if not, write to the Free Software
20 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 *
22 *   Author:
23 *      Nino Weingart
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29#ifndef _CaptureTheFlag__
30#define _CaptureTheFlag__
31
32#include "OrxonoxPrereqs.h"
33#include "FlagPickup.h"
34#include <set>
35#include "tools/Timer.h"
36#include "Gametype.h"
37
38
39namespace orxonox
40{
41    class _OrxonoxExport CaptureTheFlag : public Gametype
42    {
43    public:
44        CaptureTheFlag(BaseObject* creator);
45                virtual ~CaptureTheFlag() {}
46
47                void tick(float dt);
48
49                void setConfigValues();
50
51                virtual void playerEntered(PlayerInfo* player);
52                virtual bool playerLeft(PlayerInfo* player);
53
54                virtual bool allowPawnHit(Pawn* victim, Pawn* originator = 0);
55                virtual bool allowPawnDamage(Pawn* victim, Pawn* originator = 0);
56                virtual bool allowPawnDeath(Pawn* victim, Pawn* originator = 0);
57
58                virtual void playerScored(PlayerInfo* player);
59                virtual void showPoints();
60                virtual void endGame();
61
62                void addTeamPoints(int team, int points);
63                int getTeamPoints(int team);
64
65                virtual void playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn);
66
67                int getTeam(PlayerInfo* player);
68                inline const ColourValue& getTeamColour(int teamnr) const
69                    { return this->teamcolours_[teamnr]; }
70
71            protected:
72                virtual SpawnPoint* getBestSpawnPoint(PlayerInfo* player) const;
73                bool pawnsAreInTheSameTeam(Pawn* pawn1, Pawn* pawn2);
74
75                std::map<PlayerInfo*, int> teamnumbers_;
76                std::vector<ColourValue> teamcolours_;
77                unsigned int teams_;
78
79                FlagPickup* flagTeamBlue;
80                FlagPickup* flagTeamRed;
81                //points for each team
82                int pointsTeam1_;
83                int pointsTeam2_;
84
85    };
86}
87
88#endif /* _CaptureTheFlag_H__ */
89
Note: See TracBrowser for help on using the repository browser.