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 _TowerDefenseCenterpoint_H__ |
---|
37 | #define _TowerDefenseCenterpoint_H__ |
---|
38 | |
---|
39 | #include "towerdefense/TowerDefensePrereqs.h" |
---|
40 | |
---|
41 | #include <string> |
---|
42 | #include <util/Math.h> |
---|
43 | |
---|
44 | #include "worldentities/MobileEntity.h" |
---|
45 | |
---|
46 | namespace orxonox |
---|
47 | { |
---|
48 | class _TowerDefenseExport TowerDefenseCenterpoint : public MobileEntity |
---|
49 | { |
---|
50 | public: |
---|
51 | TowerDefenseCenterpoint(Context* context); |
---|
52 | virtual ~TowerDefenseCenterpoint() {} |
---|
53 | |
---|
54 | virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); |
---|
55 | |
---|
56 | /** |
---|
57 | @brief The width and hight in number of tiles. Default is 15 for both. |
---|
58 | */ |
---|
59 | void setWidth(unsigned int width) |
---|
60 | { this->width_ = width; } |
---|
61 | |
---|
62 | unsigned int getWidth(void) const |
---|
63 | { return this->width_; } |
---|
64 | |
---|
65 | void setHeight(unsigned int height) |
---|
66 | { this->height_ = height; } |
---|
67 | |
---|
68 | unsigned int getHeight(void) const |
---|
69 | { return this->height_; } |
---|
70 | |
---|
71 | /** |
---|
72 | @brief How to convert to world coordinates, e.g. that 0,15 is not at -8,-8 but at -80,-80 (if scale would be 10) |
---|
73 | */ |
---|
74 | void setTileScale(unsigned int tileScale) |
---|
75 | { this->tileScale_ = tileScale; } |
---|
76 | |
---|
77 | unsigned int getTileScale(void) const |
---|
78 | { return this->tileScale_; } |
---|
79 | |
---|
80 | /** |
---|
81 | @brief Set the template for the towers. |
---|
82 | @param template The template name to be applied to each tower. |
---|
83 | */ |
---|
84 | void setTowerTemplate(const std::string& templateName) |
---|
85 | { this->towerTemplate_ = templateName; } |
---|
86 | |
---|
87 | const std::string& getTowerTemplate(void) const |
---|
88 | { return this->towerTemplate_; } |
---|
89 | |
---|
90 | private: |
---|
91 | void checkGametype(); |
---|
92 | |
---|
93 | unsigned int width_; |
---|
94 | unsigned int height_; |
---|
95 | unsigned int tileScale_; |
---|
96 | |
---|
97 | std::string towerTemplate_; |
---|
98 | }; |
---|
99 | } |
---|
100 | |
---|
101 | #endif /* _TowerDefenseCenterpoint_H__ */ |
---|