Changeset 8194 for code/branches/dockingsystem/src/modules/pong/Pong.h
- Timestamp:
- Apr 6, 2011, 12:07:29 PM (13 years ago)
- Location:
- code/branches/dockingsystem
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/dockingsystem
- Property svn:mergeinfo changed
/code/branches/lastmanstanding3 (added) merged: 7903,8155,8165,8170-8175 /code/branches/tetris (added) merged: 8104-8107 /code/trunk (added) merged: 8108,8178-8179,8193
- Property svn:mergeinfo changed
-
code/branches/dockingsystem/src/modules/pong/Pong.h
r7911 r8194 27 27 */ 28 28 29 /** 30 @file Pong.h 31 @brief Declaration of the Pong class. 32 @ingroup Pong 33 */ 34 29 35 #ifndef _Pong_H__ 30 36 #define _Pong_H__ … … 33 39 34 40 #include "tools/Timer.h" 41 35 42 #include "gametypes/Deathmatch.h" 36 43 37 44 namespace orxonox 38 45 { 46 47 /** 48 @brief 49 Implements a Pong minigame (<a href="http://en.wikipedia.org/wiki/Pong">Wikipedia::Pong</a>). 50 It connects the different entities present in a game of Pong. 51 52 - The @ref orxonox::PongCenterpoint "PongCenterpoint" is the playing field for the Pong minigame, it allows for configuration of the minigame, e.g. by setting the size of the playing field, or the length of the @ref orxonox::PongBat "PongBats". The playing field is always in the x,y-plane, the x-axis being the horizontal and the z-axis being the vertical axis.<br /> 53 The Pong class redistributes the important parameters defined in @ref orxonox::PongCenterpoint "PongCenterpoint" to the other entities, that need to know them, e.g. the @ref orxonox::PongBall "PongBall" and the @ref orxonox::PongBat "PongBats".<br /> 54 The @ref orxonox::PongCenterpoint "PongCenterpoint" needs to exist in a level with the @ref orxonox::Gametype "Gametype" <em>Pong</em>. 55 - The @ref orxonox::PongBall "PongBall" is the ball both players play with. The @ref orxonox::PongBall "PongBall" both implements the movement of the ball, as well as the influence of the boundaries and consequently, also the bouncing (off the upper and lower delimiters, and as off the @ref orxonox::PongBat "PongBats") of the ball and the effects of the failure of a player to catch the ball (i.e. the scoring of the other player). 56 - The two @ref orxonox::PongBat "PongBats" are the entities through which the players can actively participate in the game, by controlling them. The @ref orxonox::PongBat "PongBat" class manages the movement (and restrictions thereof) and the influence of the players on the bats. 57 58 @author 59 Fabian 'x3n' Landau 60 61 @ingroup Pong 62 */ 39 63 class _PongExport Pong : public Deathmatch 40 64 { 41 65 public: 42 Pong(BaseObject* creator); 43 virtual ~Pong(); 66 Pong(BaseObject* creator); //!< Constructor. Registers and initializes the object. 67 virtual ~Pong(); //!< Destructor. Cleans up, if initialized. 44 68 45 virtual void start(); 46 virtual void end(); 69 virtual void start(); //!< Starts the Pong minigame. 70 virtual void end(); ///!< Ends the Pong minigame. 47 71 48 virtual void spawnPlayer(PlayerInfo* player); 72 virtual void spawnPlayer(PlayerInfo* player); //!< Spawns the input player. 49 73 50 virtual void playerScored(PlayerInfo* player); 74 virtual void playerScored(PlayerInfo* player); //!< Is called when the player scored. 51 75 76 /** 77 @brief Set the PongCenterpoint (the playing field). 78 @param center A pointer to the PongCenterpoint to be set. 79 */ 52 80 void setCenterpoint(PongCenterpoint* center) 53 81 { this->center_ = center; } 54 82 55 PlayerInfo* getLeftPlayer() const; 56 PlayerInfo* getRightPlayer() const; 83 PlayerInfo* getLeftPlayer() const; //!< Get the left player. 84 PlayerInfo* getRightPlayer() const; //!< Get the right player. 57 85 58 86 protected: 59 virtual void spawnPlayersIfRequested(); 87 virtual void spawnPlayersIfRequested(); //!< Spawns players, and fills the rest up with bots. 60 88 61 void startBall(); 62 void cleanup(); 89 void startBall(); //!< Starts the ball with some default speed. 90 void cleanup(); //!< Cleans up the Gametype by destroying the ball and the bats. 63 91 64 WeakPtr<PongCenterpoint> center_; 65 WeakPtr<PongBall> ball_; 66 WeakPtr<PongBat> bat_[2]; 67 Timer starttimer_; 92 WeakPtr<PongCenterpoint> center_; //!< The playing field. 93 WeakPtr<PongBall> ball_; //!< The Pong ball. 94 WeakPtr<PongBat> bat_[2]; //!< The two bats. 95 Timer starttimer_; //!< A timer to delay the start of the game. 68 96 }; 69 97 }
Note: See TracChangeset
for help on using the changeset viewer.