Orxonox  0.0.5 Codename: Arcturus
PongCenterpoint.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  * Fabian 'x3n' Landau
24  * Co-authors:
25  * ...
26  *
27  */
28 
35 #ifndef _PongCenterpoint_H__
36 #define _PongCenterpoint_H__
37 
38 #include "pong/PongPrereqs.h"
39 
40 #include <string>
41 
42 #include <util/Math.h>
43 
45 
46 namespace orxonox
47 {
48 
121  {
122  public:
123  PongCenterpoint(Context* context);
124  virtual ~PongCenterpoint() {}
125 
126  virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
127 
132  void setBalltemplate(const std::string& balltemplate)
133  { this->balltemplate_ = balltemplate; }
139  { return this->balltemplate_; }
140 
145  void setBattemplate(const std::string& battemplate)
146  { this->battemplate_ = battemplate; }
152  { return this->battemplate_; }
153 
158  void setFieldDimension(const Vector2& dimension)
159  { this->width_ = dimension.x; this->height_ = dimension.y; }
164  Vector2 getFieldDimension() const
165  { return Vector2(this->width_, this->height_); }
166 
171  void setBallSpeed(float ballspeed)
172  { this->ballspeed_ = ballspeed; }
177  float getBallSpeed() const
178  { return this->ballspeed_; }
179 
184  void setBallAccelerationFactor(float ballaccfactor)
185  { this->ballaccfactor_ = ballaccfactor; }
191  { return this->ballaccfactor_; }
192 
197  void setBatSpeed(float batspeed)
198  { this->batspeed_ = batspeed; }
203  float getBatSpeed() const
204  { return this->batspeed_; }
205 
210  void setBatLength(float batlength)
211  { this->batlength_ = batlength; }
216  float getBatLength() const
217  { return this->batlength_; }
218 
219  private:
220  void checkGametype();
221 
224 
225  float ballspeed_;
227  float batspeed_;
228  float batlength_;
229 
230  float width_;
231  float height_;
232  };
233 }
234 
235 #endif /* _PongCenterpoint_H__ */
float ballspeed_
The speed of then ball.
Definition: PongCenterpoint.h:225
float getBallAccelerationFactor() const
Get the ball&#39;s acceleration factor.
Definition: PongCenterpoint.h:190
float batspeed_
The speed of the bat.
Definition: PongCenterpoint.h:227
The StaticEntity is the simplest derivative of the orxonox::WorldEntity class.
Definition: StaticEntity.h:50
float batlength_
The length of the bat (in z-direction) as a percentage of the height of the playing field...
Definition: PongCenterpoint.h:228
float ballaccfactor_
The acceleration factor of the ball.
Definition: PongCenterpoint.h:226
void setFieldDimension(const Vector2 &dimension)
Set the dimensions of the playing field.
Definition: PongCenterpoint.h:158
::std::string string
Definition: gtest-port.h:756
void setBatSpeed(float batspeed)
Set the speed of the bats.
Definition: PongCenterpoint.h:197
float getBatLength() const
Get the length of the bats.
Definition: PongCenterpoint.h:216
float height_
The width of the playing field.
Definition: PongCenterpoint.h:231
xmlelement
Definition: Super.h:519
The PongCenterpoint implements the playing field Pong takes place in and allows for many parameters o...
Definition: PongCenterpoint.h:120
Declaration and implementation of several math-functions, typedefs of some Ogre::Math classes to the ...
float getBallSpeed() const
Get the speed of the ball.
Definition: PongCenterpoint.h:177
void setBalltemplate(const std::string &balltemplate)
Set the template for the ball.
Definition: PongCenterpoint.h:132
virtual ~PongCenterpoint()
Definition: PongCenterpoint.h:124
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
std::string battemplate_
The template for the bats.
Definition: PongCenterpoint.h:223
Mode
Definition: CorePrereqs.h:102
float getBatSpeed() const
Get the speed of the bats.
Definition: PongCenterpoint.h:203
void setBallSpeed(float ballspeed)
Set the speed of the ball.
Definition: PongCenterpoint.h:171
Definition: Context.h:45
void setBattemplate(const std::string &battemplate)
Set the template for the bats.
Definition: PongCenterpoint.h:145
const std::string & getBattemplate() const
Get the template of the bats.
Definition: PongCenterpoint.h:151
void setBatLength(float batlength)
Set the length of the bats.
Definition: PongCenterpoint.h:210
const std::string & getBalltemplate() const
Get the template of the ball.
Definition: PongCenterpoint.h:138
float width_
The height of the playing field.
Definition: PongCenterpoint.h:230
std::string balltemplate_
The template for the ball.
Definition: PongCenterpoint.h:222
void setBallAccelerationFactor(float ballaccfactor)
Set the ball&#39;s acceleration factor.
Definition: PongCenterpoint.h:184
#define _PongExport
Definition: PongPrereqs.h:60
Vector2 getFieldDimension() const
Get the dimensions of the playing field.
Definition: PongCenterpoint.h:164
Shared library macros, enums, constants and forward declarations for the pong module ...