Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefense.h @ 10108

Last change on this file since 10108 was 10105, checked in by erbj, 10 years ago

Added TDCoordinate and more updates

  • Property svn:eol-style set to native
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 *
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#include "TDCoordinate.h"
40#include "towerdefense/TowerDefensePrereqs.h"
41#include "gametypes/Deathmatch.h"
42
43 #include "TowerDefensePlayerStats.h"
44
45namespace orxonox
46{
47    class _TowerDefenseExport TowerDefense : public Deathmatch
48    {
49    public:
50        TowerDefense(Context* context);
51        virtual ~TowerDefense();
52
53        void addEnemy();
54        virtual void start(); //<! The function is called when the gametype starts
55        virtual void end();
56        virtual void tick(float dt);
57        //virtual void playerEntered(PlayerInfo* player);
58        //virtual bool playerLeft(PlayerInfo* player);
59
60        //virtual void pawnKilled(Pawn* victim, Pawn* killer = 0);
61        //virtual void playerScored(PlayerInfo* player, int score);
62
63
64        /*  Called by TowerDefenseCenterpoint upon game start
65            The centerpoint is used to create towers
66        */
67        void setCenterpoint(TowerDefenseCenterpoint *centerpoint);
68
69        /* Adds a tower at x, y in the playfield */
70        void addTower(int x, int y);
71
72        /* Part of a temporary hack to allow the player to add towers */
73        ConsoleCommand* dedicatedAddTower_;
74
75        //TODO: void spawnNewWave()
76        //TODO: create a timer which regularly calls the spawnNewWave function  (time driven)
77        //      or spawn a new wave when the old wave has been killed           (event driven)
78
79
80    private:
81        TowerDefenseCenterpoint *center_;
82
83        /* handles stats */
84        TowerDefensePlayerStats *stats_;
85        bool hasEnoughCreditForTower(TowerCost towerCost);
86
87        bool towerExists(int x, int y);
88
89
90        std::vector<TDCoordinate> addedTowersCoordinates_;
91        std::vector<TowerTurret*> towers_;
92    };
93}
94
95#endif /* _TowerDefense_H__ */
Note: See TracBrowser for help on using the repository browser.