Orxonox  0.0.5 Codename: Arcturus
TetrisCenterpoint.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 
35 #ifndef _TetrisCenterpoint_H__
36 #define _TetrisCenterpoint_H__
37 
38 #include "tetris/TetrisPrereqs.h"
39 
40 #include <string>
41 
42 #include <util/Math.h>
43 
45 
46 namespace orxonox
47 {//idea: add 2 triggers to the centerpoint (one to determine when a box would go above the centerpoint;
48 //the other to find out when the lowest row is filled totally)
49 
59  {
60  public:
61  TetrisCenterpoint(Context* context);
62  virtual ~TetrisCenterpoint() {}
63 
64  virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
65 
70  void setWidth(unsigned int width)
71  { this->width_ = width; }
76  unsigned int getWidth(void) const
77  { return this->width_; }
78 
83  void setHeight(unsigned int height)
84  { this->height_ = height; }
89  unsigned int getHeight(void) const
90  { return this->height_; }
91 
96  void setStoneSize(float size)
97  { this->stoneSize_ = size; }
102  float getStoneSize(void) const
103  { return this->stoneSize_; }
104 
109  void setStoneTemplate(const std::string& templateName)
110  { this->stoneTemplate_ = templateName; }
115  const std::string& getStoneTemplate(void) const
116  { return this->stoneTemplate_; }
117 
122  void setBrickTemplate(const std::string& templateName)
123  { this->brickTemplate_ = templateName; }
128  const std::string& getBrickTemplate(void) const
129  { return this->brickTemplate_; }
130 
135  void setStoneSpeed(float speed)
136  { this->stoneSpeed_ = speed; }
141  float getStoneSpeed(void)
142  { return this->stoneSpeed_; }
143 
144  private:
145  void checkGametype();
146 
147  unsigned int width_;
148  unsigned int height_;
149  float stoneSize_;
152  float stoneSpeed_;
153 
154  };
155 }
156 
157 #endif /* _TetrisCenterpoint_H__ */
float stoneSize_
Definition: TetrisCenterpoint.h:149
The StaticEntity is the simplest derivative of the orxonox::WorldEntity class.
Definition: StaticEntity.h:50
void setStoneSpeed(float speed)
Set the speed of the stones.
Definition: TetrisCenterpoint.h:135
::std::string string
Definition: gtest-port.h:756
float getStoneSpeed(void)
Get the speed of the stones.
Definition: TetrisCenterpoint.h:141
float stoneSpeed_
Definition: TetrisCenterpoint.h:152
void setStoneTemplate(const std::string &templateName)
Set the template for the stones.
Definition: TetrisCenterpoint.h:109
Shared library macros, enums, constants and forward declarations for the tetris module ...
const std::string & getBrickTemplate(void) const
Get the template for the bricks.
Definition: TetrisCenterpoint.h:128
Definition: TetrisCenterpoint.h:58
xmlelement
Definition: Super.h:519
Declaration and implementation of several math-functions, typedefs of some Ogre::Math classes to the ...
virtual ~TetrisCenterpoint()
Definition: TetrisCenterpoint.h:62
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
Mode
Definition: CorePrereqs.h:102
unsigned int width_
Definition: TetrisCenterpoint.h:147
Definition: Context.h:45
void setBrickTemplate(const std::string &templateName)
Set the template for the bricks.
Definition: TetrisCenterpoint.h:122
std::string brickTemplate_
Definition: TetrisCenterpoint.h:151
const std::string & getStoneTemplate(void) const
Get the template for the stones.
Definition: TetrisCenterpoint.h:115
std::string stoneTemplate_
Definition: TetrisCenterpoint.h:150
float getStoneSize(void) const
Get the size of a single stone.
Definition: TetrisCenterpoint.h:102
void setStoneSize(float size)
Set the size of a single stone.
Definition: TetrisCenterpoint.h:96
#define _TetrisExport
Definition: TetrisPrereqs.h:58
void setWidth(unsigned int width)
Set the width of the playing field.
Definition: TetrisCenterpoint.h:70
unsigned int getHeight(void) const
Get the height of the playing field.
Definition: TetrisCenterpoint.h:89
void setHeight(unsigned int height)
Set the height of the playing field.
Definition: TetrisCenterpoint.h:83
unsigned int getWidth(void) const
Get the width of the playing field.
Definition: TetrisCenterpoint.h:76
unsigned int height_
Definition: TetrisCenterpoint.h:148