[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" |
---|
[9204] | 42 | |
---|
[9211] | 43 | #include "TowerDefensePlayerStats.h" |
---|
| 44 | |
---|
[9112] | 45 | namespace orxonox |
---|
| 46 | { |
---|
[9250] | 47 | class _TowerDefenseExport TowerDefense : public Deathmatch |
---|
[9112] | 48 | { |
---|
[9136] | 49 | public: |
---|
| 50 | TowerDefense(BaseObject* creator); |
---|
| 51 | virtual ~TowerDefense(); |
---|
| 52 | |
---|
| 53 | virtual void start(); //<! The function is called when the gametype starts |
---|
[9140] | 54 | virtual void end(); |
---|
[9136] | 55 | virtual void tick(float dt); |
---|
| 56 | //virtual void playerEntered(PlayerInfo* player); |
---|
| 57 | //virtual bool playerLeft(PlayerInfo* player); |
---|
| 58 | |
---|
| 59 | //virtual void pawnKilled(Pawn* victim, Pawn* killer = 0); |
---|
| 60 | //virtual void playerScored(PlayerInfo* player); |
---|
| 61 | |
---|
[9142] | 62 | |
---|
[9139] | 63 | /* Called by TowerDefenseCenterpoint upon game start |
---|
| 64 | The centerpoint is used to create towers |
---|
| 65 | */ |
---|
[9136] | 66 | void setCenterpoint(TowerDefenseCenterpoint *centerpoint); |
---|
| 67 | |
---|
[9139] | 68 | /* Adds a tower at x, y in the playfield */ |
---|
| 69 | void addTower(int x, int y); |
---|
| 70 | |
---|
[9136] | 71 | /* Part of a temporary hack to allow the player to add towers */ |
---|
| 72 | ConsoleCommand* dedicatedAddTower_; |
---|
| 73 | |
---|
[9143] | 74 | //TODO: void spawnNewWave() |
---|
| 75 | //TODO: create a timer which regularly calls the spawnNewWave function (time driven) |
---|
| 76 | // or spawn a new wave when the old wave has been killed (event driven) |
---|
| 77 | |
---|
| 78 | |
---|
[9136] | 79 | private: |
---|
| 80 | TowerDefenseCenterpoint *center_; |
---|
[9207] | 81 | |
---|
| 82 | /* handles stats */ |
---|
| 83 | TowerDefensePlayerStats *stats_; |
---|
[9211] | 84 | bool hasEnoughCreditForTower(TowerCost towerCost); |
---|
[9160] | 85 | |
---|
[9211] | 86 | bool towerExists(int x, int y); |
---|
[9142] | 87 | |
---|
[9160] | 88 | typedef struct { |
---|
| 89 | int x; |
---|
| 90 | int y; |
---|
[9211] | 91 | } Coordinate; |
---|
[9160] | 92 | |
---|
[9211] | 93 | std::vector<Coordinate> addedTowersCoordinates_; |
---|
[9160] | 94 | std::vector<Tower*> towers_; |
---|
[9112] | 95 | }; |
---|
| 96 | } |
---|
| 97 | |
---|
| 98 | #endif /* _TowerDefense_H__ */ |
---|