Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 9161 was 9160, checked in by mentzerf, 13 years ago
  • Fixed height of towers

+ not adding towers when they were added already

File size: 2.6 KB
RevLine 
[9098]1/*
[9112]2 *   ORXONOX - the hottest 3D action shooter ever to exist
3 *                    > www.orxonox.net <
[9098]4 *
[9112]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 *
[9098]27 */
[9141]28         
29 /**
30         @brief
31         GameType class for TowerDefense. See TowerDefenseReadme.txt for Information.
32         
33         @ingroup TowerDefense
34 */
35         
[9098]36
[9112]37#ifndef _TowerDefense_H__
38#define _TowerDefense_H__
[9098]39
[9112]40#include "towerdefense/TowerDefensePrereqs.h"
41#include "gametypes/Deathmatch.h"
[9098]42
[9112]43namespace orxonox
44{
45    class _OrxonoxExport TowerDefense : public Deathmatch
46    {
[9136]47        public:
48                TowerDefense(BaseObject* creator);
49                virtual ~TowerDefense();
50               
51                virtual void start(); //<! The function is called when the gametype starts
[9140]52                virtual void end();
[9136]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               
[9142]60               
[9139]61                /*      Called by TowerDefenseCenterpoint upon game start
62                        The centerpoint is used to create towers
63                */
[9136]64                void setCenterpoint(TowerDefenseCenterpoint *centerpoint);
65               
[9139]66                /* Adds a tower at x, y in the playfield */
67                void addTower(int x, int y);
68               
[9136]69                /* Part of a temporary hack to allow the player to add towers */
70                ConsoleCommand* dedicatedAddTower_;
71               
[9143]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
[9136]77        private:
78//              WeakPtr<TowerDefenseCenterpoint> center_;
79                TowerDefenseCenterpoint *center_;
[9160]80       
81       
82                bool hasTower(int x, int y);
[9142]83               
[9160]84                typedef struct {
85                        int x;
86                        int y;
87                } coordinate; 
88               
89       
90               
91                std::vector<coordinate> addedTowersCoordinates_;
92                std::vector<Tower*> towers_;
93               
[9142]94                void addWaypointsAndFirstEnemy();
[9112]95    };
96}
97
98#endif /* _TowerDefense_H__ */
Note: See TracBrowser for help on using the repository browser.