| 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 | See TowerDefenseReadme.txt for Information. |
|---|
| 32 | @ingroup TowerDefense |
|---|
| 33 | */ |
|---|
| 34 | |
|---|
| 35 | |
|---|
| 36 | #ifndef _TowerDefenseField_H__ |
|---|
| 37 | #define _TowerDefenseField_H__ |
|---|
| 38 | |
|---|
| 39 | #include "towerdefense/TowerDefensePrereqs.h" |
|---|
| 40 | #include "TowerDefenseTower.h" |
|---|
| 41 | #include "TowerDefenseCenterpoint.h" |
|---|
| 42 | #include <string> |
|---|
| 43 | #include "graphics/Model.h" |
|---|
| 44 | #include "worldentities/MovableEntity.h" |
|---|
| 45 | |
|---|
| 46 | namespace orxonox |
|---|
| 47 | { |
|---|
| 48 | enum class TowerDefenseFieldType |
|---|
| 49 | { |
|---|
| 50 | FREE, |
|---|
| 51 | STREET, |
|---|
| 52 | START, |
|---|
| 53 | END, |
|---|
| 54 | OBSTACLE, |
|---|
| 55 | TOWER |
|---|
| 56 | }; |
|---|
| 57 | |
|---|
| 58 | |
|---|
| 59 | class _TowerDefenseExport TowerDefenseField : public MovableEntity |
|---|
| 60 | { |
|---|
| 61 | public: |
|---|
| 62 | TowerDefenseField(Context* context); |
|---|
| 63 | virtual ~TowerDefenseField() {} |
|---|
| 64 | virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; |
|---|
| 65 | const bool isFree() const |
|---|
| 66 | { return type_==TowerDefenseFieldType::FREE; } |
|---|
| 67 | virtual void create(char object, char param); |
|---|
| 68 | virtual void setCenterpoint(TowerDefenseCenterpoint* center); |
|---|
| 69 | virtual void upgrade(); |
|---|
| 70 | virtual int getUpgrade(); |
|---|
| 71 | virtual TowerDefenseFieldType getType(); |
|---|
| 72 | virtual void setUpgrade(int upgrade); |
|---|
| 73 | virtual bool canUpgrade(); |
|---|
| 74 | virtual void createFree(int orientation); |
|---|
| 75 | virtual void createStart(int orientation); |
|---|
| 76 | virtual void createEnd(int orientation); |
|---|
| 77 | virtual void createStraight(int orientation); |
|---|
| 78 | virtual void createLCurve(int orientation); |
|---|
| 79 | virtual void createRCurve(int orientation); |
|---|
| 80 | virtual void createObstacle(int orientation); |
|---|
| 81 | virtual void createTower(int upgrade); |
|---|
| 82 | virtual int getAngle(); |
|---|
| 83 | private: |
|---|
| 84 | virtual void setAngle(int newAngle); |
|---|
| 85 | virtual void destroyTower(); |
|---|
| 86 | int angle_; |
|---|
| 87 | TowerDefenseFieldType type_; |
|---|
| 88 | Model* modelGround_; |
|---|
| 89 | Model* modelObject_; |
|---|
| 90 | TowerDefenseTower* tower_; |
|---|
| 91 | TowerDefenseCenterpoint* center_; |
|---|
| 92 | int upgrade_; |
|---|
| 93 | |
|---|
| 94 | }; |
|---|
| 95 | } |
|---|
| 96 | |
|---|
| 97 | #endif /* _TowerDefenseField_H__ */ |
|---|