Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/newlevel2012/src/modules/towerdefense/TowerDefense.h @ 9172

Last change on this file since 9172 was 9172, checked in by mentzerf, 12 years ago
  • Tried to add HUD. Failed miserably. Does not compile any more =(
File size: 2.6 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 *
24 *   Co-authors:
25 *      ...
26 *
27 */
28         
29 /**
30         @brief
31         GameType class for TowerDefense. See TowerDefenseReadme.txt for Information.
32         
33         @ingroup TowerDefense
34 */
35         
36
37#ifndef _TowerDefense_H__
38#define _TowerDefense_H__
39
40#include "towerdefense/TowerDefensePrereqs.h"
41#include "gametypes/Deathmatch.h"
42
43namespace orxonox
44{
45    class _OrxonoxExport TowerDefense : public Deathmatch
46    {
47        public:
48                TowerDefense(BaseObject* creator);
49                virtual ~TowerDefense();
50               
51                virtual void start(); //<! The function is called when the gametype starts
52                virtual void end();
53                virtual void tick(float dt);
54                //virtual void playerEntered(PlayerInfo* player);
55                //virtual bool playerLeft(PlayerInfo* player);
56               
57                //virtual void pawnKilled(Pawn* victim, Pawn* killer = 0);
58                //virtual void playerScored(PlayerInfo* player);
59               
60               
61                /*      Called by TowerDefenseCenterpoint upon game start
62                        The centerpoint is used to create towers
63                */
64                void setCenterpoint(TowerDefenseCenterpoint *centerpoint);
65               
66                /* Adds a tower at x, y in the playfield */
67                void addTower(int x, int y);
68               
69                /* Part of a temporary hack to allow the player to add towers */
70                ConsoleCommand* dedicatedAddTower_;
71               
72                //TODO: void spawnNewWave()
73            //TODO: create a timer which regularly calls the spawnNewWave function  (time driven)
74                //      or spawn a new wave when the old wave has been killed           (event driven)
75
76
77        private:
78//              WeakPtr<TowerDefenseCenterpoint> center_;
79                TowerDefenseCenterpoint *center_;
80       
81                TowerDefensePlayerStats *stats_;
82       
83                bool hasTower(int x, int y);
84               
85                typedef struct {
86                        int x;
87                        int y;
88                } coordinate; 
89               
90       
91               
92                std::vector<coordinate> addedTowersCoordinates_;
93                std::vector<Tower*> towers_;
94               
95                void addWaypointsAndFirstEnemy();
96    };
97}
98
99#endif /* _TowerDefense_H__ */
Note: See TracBrowser for help on using the repository browser.