Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/towerdefenseFS15/src/modules/towerdefense/TowerDefense.h @ 10397

Last change on this file since 10397 was 10397, checked in by fvultier, 9 years ago

Added missmissing #include _.h Now the program compiles without any error.

  • Property svn:eol-style set to native
File size: 3.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 "TowerDefenseSelecter.h"
41#include "towerdefense/TowerDefensePrereqs.h"
42#include "gametypes/TeamDeathmatch.h"
43#include "TowerDefenseEnemy.h"
44#include "util/Output.h"
45#include "core/object/WeakPtr.h"
46#include "TowerDefenseSelecter.h"
47
48
49namespace orxonox
50{
51    class _TowerDefenseExport TowerDefense : public TeamDeathmatch
52    {
53    public:
54        TowerDefense(Context* context);
55        virtual ~TowerDefense();
56
57        std::vector<orxonox::WeakPtr<TowerDefenseEnemy> > TowerDefenseEnemyvector;
58        Model* towerModelMatrix[16][16];
59        TowerDefenseTower* towerTurretMatrix[16][16];
60        void addTowerDefenseEnemy(std::vector<TDCoordinate*> path, int templatenr);
61        virtual void start(); //<! The function is called when the gametype starts
62        virtual void end();
63        virtual void tick(float dt);
64        //virtual void playerEntered(PlayerInfo* player);
65        //virtual bool playerLeft(PlayerInfo* player);
66        //Player Stats (set,get, reduce)
67        int getCredit(){ return this->credit_; }
68        int getLifes(){ return this->lifes_; }
69        int getWaveNumber(){ return this->waves_; }
70        void setCredit(int credit){ credit_ = credit; }
71        void setLifes(int lifes){ lifes_ = lifes; }
72        void setWaveNumber(int wavenumber){ waves_=wavenumber; }
73        void buyTower(int cost){ credit_ -= cost;}
74        void addCredit(int credit) { credit_+=credit; }
75        void nextwave(){ TowerDefenseEnemyvector.clear(); waves_++; time=0;}
76        int reduceLifes(int NumberofLifes){ return lifes_-=NumberofLifes; }
77        TDCoordinate* selectedPos;
78        TowerDefenseSelecter* selecter;
79
80        //virtual void pawnKilled(Pawn* victim, Pawn* killer = 0);
81        //virtual void playerScored(PlayerInfo* player, int score);
82
83
84        /*  Called by TowerDefenseCenterpoint upon game start
85            The centerpoint is used to create towers
86        */
87        void setCenterpoint(TowerDefenseCenterpoint *centerpoint);
88
89        /* Adds a tower at x, y in the playfield */
90        void addTower(int x, int y);
91
92        void upgradeTower(int x, int y);
93
94        //TODO: void spawnNewWave()
95        //TODO: create a timer which regularly calls the spawnNewWave function  (time driven)
96        //      or spawn a new wave when the old wave has been killed           (event driven)
97
98
99    private:
100        TowerDefenseCenterpoint *center_;
101        float time;
102//        float time2;
103        int credit_;
104        int waves_;
105        int lifes_;
106        Timer nextwaveTimer_;
107
108        /* handles stats */
109        bool hasEnoughCreditForTower(int towerCost);
110        bool hasEnoughCreditForUpgrade();
111
112
113
114        std::vector<TowerTurret*> towers_;
115    };
116}
117
118#endif /* _TowerDefense_H__ */
Note: See TracBrowser for help on using the repository browser.