Orxonox  0.0.5 Codename: Arcturus
TowerDefenseCenterpoint.h
Go to the documentation of this file.
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 #ifndef _TowerDefenseCenterpoint_H__
31 #define _TowerDefenseCenterpoint_H__
32 
34 
35 #include <string>
36 #include <util/Math.h>
37 #include "TowerDefenseTower.h"
39 
40 namespace orxonox
41 {
48  {
49  public:
52 
53  virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
54 
58  void setWidth(unsigned int width)
59  { this->width_ = width; }
60  unsigned int getWidth(void) const
61  { return this->width_; }
62  void setHeight(unsigned int height)
63  { this->height_ = height; }
64  unsigned int getHeight(void) const
65  { return this->height_; }
66  void setFields(const std::string& newFields)
67  { this->fields_ = newFields; trimString(&fields_); }
68  const std::string& getFields() const
69  { return this->fields_; }
70  void setSelecterTemplate(const std::string& newTemplate)
71  { this->selecterTemplate_ = newTemplate; }
73  { return this->selecterTemplate_; }
74 
75  void setTower1Template(const std::string& newTemplate)
76  { this->towerTemplates_[0] = newTemplate;}
78  { return this->towerTemplates_[0]; }
79  void setTower2Template(const std::string& newTemplate)
80  { this->towerTemplates_[1] = newTemplate; }
82  { return this->towerTemplates_[1]; }
83  void setTower3Template(const std::string& newTemplate)
84  { this->towerTemplates_[2] = newTemplate; }
86  { return this->towerTemplates_[2]; }
87  void setTower4Template(const std::string& newTemplate)
88  { this->towerTemplates_[3] = newTemplate; }
90  { return this->towerTemplates_[3]; }
91  void setTower5Template(const std::string& newTemplate)
92  { this->towerTemplates_[4] = newTemplate; }
94  { return this->towerTemplates_[4]; }
95 
96  void setTower1Cost(const int& newCost)
97  { this->towerCosts_[0] = newCost;}
98  const int& getTower1Cost() const
99  { return this->towerCosts_[0]; }
100  void setTower2Cost(const int& newCost)
101  { this->towerCosts_[1] = newCost; }
102  const int& getTower2Cost() const
103  { return this->towerCosts_[1]; }
104  void setTower3Cost(const int& newCost)
105  { this->towerCosts_[2] = newCost; }
106  const int& getTower3Cost() const
107  { return this->towerCosts_[2]; }
108  void setTower4Cost(const int& newCost)
109  { this->towerCosts_[3] = newCost; }
110  const int& getTower4Cost() const
111  { return this->towerCosts_[3]; }
112  void setTower5Cost(const int& newCost)
113  { this->towerCosts_[4] = newCost; }
114  const int& getTower5Cost() const
115  { return this->towerCosts_[4]; }
116 
117  const int getTowerCost(int upgrade) const;
118 
119 
123  void setTileScale(unsigned int tileScale)
124  { this->tileScale_ = tileScale; }
125 
126  unsigned int getTileScale(void) const
127  { return this->tileScale_; }
128 
129  private:
130  void checkGametype();
131  void trimString(std::string*);
133  std::string towerTemplates_[5];
134  int towerCosts_[5];
136  unsigned int width_;
137  unsigned int height_;
138  unsigned int tileScale_;
139  };
140 }
141 
142 #endif /* _TowerDefenseCenterpoint_H__ */
void setTower5Template(const std::string &newTemplate)
Definition: TowerDefenseCenterpoint.h:91
void setTower1Template(const std::string &newTemplate)
Definition: TowerDefenseCenterpoint.h:75
void setFields(const std::string &newFields)
Definition: TowerDefenseCenterpoint.h:66
Shared library macros, enums, constants and forward declarations for the TowerDefense module ...
void setTower3Template(const std::string &newTemplate)
Definition: TowerDefenseCenterpoint.h:83
::std::string string
Definition: gtest-port.h:756
const std::string & getSelecterTemplate() const
Definition: TowerDefenseCenterpoint.h:72
virtual ~TowerDefenseCenterpoint()
Definition: TowerDefenseCenterpoint.h:51
const std::string & getFields() const
Definition: TowerDefenseCenterpoint.h:68
void setTileScale(unsigned int tileScale)
How to convert to world coordinates, e.g.
Definition: TowerDefenseCenterpoint.h:123
unsigned int getTileScale(void) const
Definition: TowerDefenseCenterpoint.h:126
void setWidth(unsigned int width)
The width and hight in number of tiles.
Definition: TowerDefenseCenterpoint.h:58
std::string selecterTemplate_
Definition: TowerDefenseCenterpoint.h:132
unsigned int getWidth(void) const
Definition: TowerDefenseCenterpoint.h:60
void setSelecterTemplate(const std::string &newTemplate)
Definition: TowerDefenseCenterpoint.h:70
unsigned int getHeight(void) const
Definition: TowerDefenseCenterpoint.h:64
xmlelement
Definition: Super.h:519
const std::string & getTower2Template() const
Definition: TowerDefenseCenterpoint.h:81
Declaration and implementation of several math-functions, typedefs of some Ogre::Math classes to the ...
const std::string & getTower3Template() const
Definition: TowerDefenseCenterpoint.h:85
The MobileEntity is a derived class from orxonox::WorldEntity and orxonox::Tickable.
Definition: MobileEntity.h:53
void setTower5Cost(const int &newCost)
Definition: TowerDefenseCenterpoint.h:112
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
unsigned int width_
Definition: TowerDefenseCenterpoint.h:136
void setTower2Template(const std::string &newTemplate)
Definition: TowerDefenseCenterpoint.h:79
Mode
Definition: CorePrereqs.h:102
void setTower4Cost(const int &newCost)
Definition: TowerDefenseCenterpoint.h:108
const std::string & getTower5Template() const
Definition: TowerDefenseCenterpoint.h:93
unsigned int height_
Definition: TowerDefenseCenterpoint.h:137
const int & getTower4Cost() const
Definition: TowerDefenseCenterpoint.h:110
Definition: Context.h:45
unsigned int tileScale_
Definition: TowerDefenseCenterpoint.h:138
std::string fields_
Definition: TowerDefenseCenterpoint.h:135
void setTower3Cost(const int &newCost)
Definition: TowerDefenseCenterpoint.h:104
#define _TowerDefenseExport
Definition: TowerDefensePrereqs.h:58
const std::string & getTower4Template() const
Definition: TowerDefenseCenterpoint.h:89
const std::string & getTower1Template() const
Definition: TowerDefenseCenterpoint.h:77
const int & getTower2Cost() const
Definition: TowerDefenseCenterpoint.h:102
void setTower4Template(const std::string &newTemplate)
Definition: TowerDefenseCenterpoint.h:87
void setHeight(unsigned int height)
Definition: TowerDefenseCenterpoint.h:62
void setTower2Cost(const int &newCost)
Definition: TowerDefenseCenterpoint.h:100
const int & getTower1Cost() const
Definition: TowerDefenseCenterpoint.h:98
const int & getTower3Cost() const
Definition: TowerDefenseCenterpoint.h:106
const int & getTower5Cost() const
Definition: TowerDefenseCenterpoint.h:114
See TowerDefenseReadme.txt for Information.
Definition: TowerDefenseCenterpoint.h:47
void setTower1Cost(const int &newCost)
Definition: TowerDefenseCenterpoint.h:96