Changeset 8105 for code/branches/tetris/src/modules/pong/PongBat.h
- Timestamp:
- Mar 23, 2011, 12:13:34 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/tetris/src/modules/pong/PongBat.h
r7163 r8105 27 27 */ 28 28 29 /** 30 @file PongBat.h 31 @brief Declaration of the PongBat class. 32 @ingroup Pong 33 */ 34 29 35 #ifndef _PongBat_H__ 30 36 #define _PongBat_H__ 31 37 32 38 #include "pong/PongPrereqs.h" 39 33 40 #include "worldentities/ControllableEntity.h" 34 41 35 42 namespace orxonox 36 43 { 44 45 /** 46 @brief 47 The PongBat class manages the bats for @ref orxonox::Pong "Pong", which are the elements controlled by the player. 48 49 It is responsible for the movement (controlled by the players) of the bat. 50 51 @author 52 Fabian 'x3n' Landau 53 54 @ingroup Pong 55 */ 37 56 class _PongExport PongBat : public ControllableEntity 38 57 { 39 58 public: 40 PongBat(BaseObject* creator); 59 PongBat(BaseObject* creator); //!< Constructor. Registers and initializes the object. 41 60 virtual ~PongBat() {} 42 61 43 62 virtual void tick(float dt); 44 63 45 virtual void moveFrontBack(const Vector2& value); 46 virtual void moveRightLeft(const Vector2& value); 64 virtual void moveFrontBack(const Vector2& value); //!< Overloaded the function to steer the bat up and down. 65 virtual void moveRightLeft(const Vector2& value); //!< Overloaded the function to steer the bat up and down. 47 66 48 virtual void changedPlayer(); 67 virtual void changedPlayer(); //!< Is called when the player changed. 49 68 69 /** 70 @brief Set the speed of the bat. 71 @param speed The speed to be set. 72 */ 50 73 void setSpeed(float speed) 51 74 { this->speed_ = speed; } 75 /** 76 @brief Get the speed of the bat. 77 @return Returns the speed of the bat. 78 */ 52 79 float getSpeed() const 53 80 { return this->speed_; } 54 81 82 /** 83 @brief Set the height of the playing field. 84 @param height The height of the playing field. 85 */ 55 86 void setFieldHeight(float height) 56 87 { this->fieldHeight_ = height; } 88 /** 89 @brief Get the height of the playing field. 90 @return Returns the height of the playing field. 91 */ 57 92 float getFieldHeight() const 58 93 { return this->fieldHeight_; } 59 94 95 /** 96 @brief Set the length of the bat. 97 @param length The length of the bat (in z-direction) as percentage of the height of the playing field. 98 */ 60 99 void setLength(float length) 61 100 { this->length_ = length; } 101 /** 102 @brief get the length of the bat. 103 @return Returns the length of the bat (in z-direction) as percentage of the height of the playing field. 104 */ 62 105 float getLength() const 63 106 { return this->length_; } 64 107 65 108 private: 66 void registerVariables(); 109 void registerVariables(); //!< Registers variables to be synchronized over the network. 67 110 68 float movement_; 69 bool bMoveLocal_; 70 float speed_; 71 float length_; 72 float fieldHeight_; 73 bool bSteadiedPosition_; 111 float movement_; //!< The amount (and direction), in z-direction, of movement of the bat. 112 bool bMoveLocal_; //TODO ??? 113 float speed_; //!< The movementspeed of the bat. 114 float length_; //!< The length of the bat (in z-direction) as percentage of the height of the playing field. 115 float fieldHeight_; //!< The height of the playing field. 116 bool bSteadiedPosition_; //TODO: ??? 74 117 }; 75 118 }
Note: See TracChangeset
for help on using the changeset viewer.