Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/presentation2012/src/modules/gametypes/CaptureTheFlag.h @ 9241

Last change on this file since 9241 was 9241, checked in by decapitb, 12 years ago

tower defense update

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_H__
30#define _CaptureTheFlag_H__
31
32#include "OrxonoxPrereqs.h"
33#include <set>
34#include "core/CoreIncludes.h"
35
36#include "tools/Timer.h"
37#include "gametypes/TeamBaseMatch.h"
38#include "infos/PlayerInfo.h"
39#include "pickup/items/FlagPickup.h"
40#include "pickup/PickupPrereqs.h"
41
42namespace orxonox
43{
44    class _OrxonoxExport CaptureTheFlag : public TeamBaseMatch
45    {
46    public:
47        CaptureTheFlag(BaseObject* creator);
48        virtual ~CaptureTheFlag() {}
49       
50        void tick(float dt);
51       
52        void setConfigValues();
53       
54        virtual void playerEntered(PlayerInfo* player);
55        virtual bool playerLeft(PlayerInfo* player);
56       
57        virtual bool allowPawnHit(Pawn* victim, Pawn* originator = 0);
58        virtual bool allowPawnDamage(Pawn* victim, Pawn* originator = 0);
59        virtual bool allowPawnDeath(Pawn* victim, Pawn* originator = 0);
60       
61        virtual void playerScored(PlayerInfo* player);
62        virtual void showPoints();
63        virtual void endGame();
64       
65        void addTeamPoints(int team, int points);
66        int getTeamPoints(int team);
67       
68        virtual void playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn);
69       
70        int getTeam(PlayerInfo* player);
71        inline const ColourValue& getTeamColour(int teamnr) const
72        { return this->teamcolours_[teamnr]; }
73       
74    protected:
75        virtual SpawnPoint* getBestSpawnPoint(PlayerInfo* player) const;
76        bool pawnsAreInTheSameTeam(Pawn* pawn1, Pawn* pawn2);
77       
78        std::map<PlayerInfo*, int> teamnumbers_;
79        std::vector<ColourValue> teamcolours_;
80        unsigned int teams_;
81       
82        FlagPickup* flagTeamBlue;
83        FlagPickup* flagTeamRed;
84       
85        //points for each team
86        int pointsTeam1_;
87        int pointsTeam2_;
88        int teamnr;
89       
90    };
91}
92
93#endif // _CaptureTheFlag_H__
94
Note: See TracBrowser for help on using the repository browser.