Orxonox  0.0.5 Codename: Arcturus
PongBat.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 _PongBat_H__
36 #define _PongBat_H__
37 
38 #include "pong/PongPrereqs.h"
39 
41 
42 namespace orxonox
43 {
44 
57  {
58  public:
59  PongBat(Context* context);
60  virtual ~PongBat() {}
61 
62  virtual void tick(float dt) override;
63 
64  virtual void moveFrontBack(const Vector2& value) override;
65  virtual void moveRightLeft(const Vector2& value) override;
66 
67  virtual void changedPlayer() override;
68 
73  void setSpeed(float speed)
74  { this->speed_ = speed; }
79  float getSpeed() const
80  { return this->speed_; }
81 
86  void setFieldHeight(float height)
87  { this->fieldHeight_ = height; }
92  float getFieldHeight() const
93  { return this->fieldHeight_; }
94 
99  void setLength(float length)
100  { this->length_ = length; }
105  float getLength() const
106  { return this->length_; }
107 
108  private:
109  void registerVariables();
110 
111  float movement_;
112  bool bMoveLocal_;
113  float speed_;
114  float length_;
115  float fieldHeight_;
117  };
118 }
119 
120 #endif /* _PongBat_H__ */
float speed_
The movement speed of the bat.
Definition: PongBat.h:113
bool bMoveLocal_
Helper to know whether the movement is caused by moveFrontBack() or moveRightLeft().
Definition: PongBat.h:112
float fieldHeight_
The height of the playing field.
Definition: PongBat.h:115
void setLength(float length)
Set the length of the bat.
Definition: PongBat.h:99
void setFieldHeight(float height)
Set the height of the playing field.
Definition: PongBat.h:86
void setSpeed(float speed)
Set the speed of the bat.
Definition: PongBat.h:73
virtual ~PongBat()
Definition: PongBat.h:60
float movement_
The amount (and direction), in z-direction, of movement of the bat.
Definition: PongBat.h:111
bool bSteadiedPosition_
Helper boolean, to keep track of when to steady the position, to ensure network synchronicity.
Definition: PongBat.h:116
float getSpeed() const
Get the speed of the bat.
Definition: PongBat.h:79
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
float length_
The length of the bat (in z-direction) as percentage of the height of the playing field...
Definition: PongBat.h:114
Definition: Context.h:45
float getLength() const
Get the length of the bat.
Definition: PongBat.h:105
The PongBat class manages the bats for Pong, which are the elements controlled by the players...
Definition: PongBat.h:56
float getFieldHeight() const
Get the height of the playing field.
Definition: PongBat.h:92
#define _PongExport
Definition: PongPrereqs.h:60
Shared library macros, enums, constants and forward declarations for the pong module ...
The ControllableEntity is derived from the orxonox::MobileEntity.
Definition: ControllableEntity.h:48