[Orxonox-commit 3418] r8105 - in code/branches/tetris: doc/api src/modules/pickup src/modules/pong

dafrick at orxonox.net dafrick at orxonox.net
Wed Mar 23 12:13:34 CET 2011


Author: dafrick
Date: 2011-03-23 12:13:34 +0100 (Wed, 23 Mar 2011)
New Revision: 8105

Modified:
   code/branches/tetris/doc/api/Groups.dox
   code/branches/tetris/src/modules/pickup/Pickup.h
   code/branches/tetris/src/modules/pong/Pong.h
   code/branches/tetris/src/modules/pong/PongBall.cc
   code/branches/tetris/src/modules/pong/PongBall.h
   code/branches/tetris/src/modules/pong/PongBat.cc
   code/branches/tetris/src/modules/pong/PongBat.h
   code/branches/tetris/src/modules/pong/PongCenterpoint.cc
   code/branches/tetris/src/modules/pong/PongCenterpoint.h
Log:

More documentation for Pong.



Modified: code/branches/tetris/doc/api/Groups.dox
===================================================================
--- code/branches/tetris/doc/api/Groups.dox	2011-03-23 06:40:36 UTC (rev 8104)
+++ code/branches/tetris/doc/api/Groups.dox	2011-03-23 11:13:34 UTC (rev 8105)
@@ -485,7 +485,9 @@
     @section PickupTechnicalDetails Technical details
 
     @image html pickupmodule.png
+*/
 
+/**
     @defgroup PickupItems Items
     @ingroup Pickup
 
@@ -495,6 +497,8 @@
 /**
     @defgroup Pong Pong
     @ingroup Modules
+    
+    Pong is a minigame.
 */
 
 /**

Modified: code/branches/tetris/src/modules/pickup/Pickup.h
===================================================================
--- code/branches/tetris/src/modules/pickup/Pickup.h	2011-03-23 06:40:36 UTC (rev 8104)
+++ code/branches/tetris/src/modules/pickup/Pickup.h	2011-03-23 11:13:34 UTC (rev 8105)
@@ -80,7 +80,7 @@
     @brief
         The Pickup class offers (useful) base functionality for a wide range of pickups.
 
-        Pickups ingeriting from this class can choose an activation type and a duration type.
+        Pickups inheriting from this class can choose an activation type and a duration type.
         - The <b>activationType</b> deals with what happens to the Pickup as soon as it is picked up. It can either be set to <em>immediate</em>, which means that the Pickup is activated/used immediately upon being picked up. Or to <em>onUse</em>, which means, that the Pickup will be activated/used if some outside entity (most commonly the player through the PickupInventory) decides to use it. Default is <em>immediate</em>.
         - The <b>durationType</b> deals with whether the Pickup has a continuous effect or whether its effect is focused on a singular instant. It can either be set to <em>once</em>, which means, that the Pickup just has an effect (at a singular instant in time) and is done once that effect has been applied. Or to <em>continuous</em>, which means that the effect of the Pickup unfolds over some timespan. Default is <em>once</em>.
 

Modified: code/branches/tetris/src/modules/pong/Pong.h
===================================================================
--- code/branches/tetris/src/modules/pong/Pong.h	2011-03-23 06:40:36 UTC (rev 8104)
+++ code/branches/tetris/src/modules/pong/Pong.h	2011-03-23 11:13:34 UTC (rev 8105)
@@ -47,8 +47,9 @@
     /**
     @brief
         Implements a Pong minigame.
-
-        //TODO: Add details to different classes used and how.
+        It connects the different entities present in a game of Pong.
+        
+        //TODO: List and add details to different classes used and how.
         PongBall, is the ball, PongBats are the things that can be moved by the players (ControllableEntities), PongCenterpoint is the playing field. (x-z area)
 
     @author

Modified: code/branches/tetris/src/modules/pong/PongBall.cc
===================================================================
--- code/branches/tetris/src/modules/pong/PongBall.cc	2011-03-23 06:40:36 UTC (rev 8104)
+++ code/branches/tetris/src/modules/pong/PongBall.cc	2011-03-23 11:13:34 UTC (rev 8105)
@@ -100,7 +100,7 @@
     /**
     @brief
         Is called every tick.
-        //TODO: Explain in detail what happens here.
+        Handles the movement of the ball and its interaction with the boundaries and bats.
     @param dt
         The time since the last tick.
     */
@@ -225,24 +225,32 @@
 
     /**
     @brief
-        Set the 
+        Set the bats for the ball.
+    @param bats
+        An array (of size 2) of weak pointers, to be set as the new bats.
     */
     void PongBall::setBats(WeakPtr<PongBat>* bats)
     {
-        if (this->bDeleteBats_)
+        if (this->bDeleteBats_) // If there are already some bats, delete them.
         {
             delete[] this->bat_;
             this->bDeleteBats_ = false;
         }
 
         this->bat_ = bats;
+        // Also store their object IDs, for synchronization.
         this->batID_[0] = this->bat_[0]->getObjectID();
         this->batID_[1] = this->bat_[1]->getObjectID();
     }
 
+    /**
+    @brief
+        Get the bats over the network.
+    */
     void PongBall::applyBats()
     {
-        if (!this->bat_)
+        // Make space for the bats, if they don't exist, yet.
+        if (this->bat_ == NULL)
         {
             this->bat_ = new WeakPtr<PongBat>[2];
             this->bDeleteBats_ = true;

Modified: code/branches/tetris/src/modules/pong/PongBall.h
===================================================================
--- code/branches/tetris/src/modules/pong/PongBall.h	2011-03-23 06:40:36 UTC (rev 8104)
+++ code/branches/tetris/src/modules/pong/PongBall.h	2011-03-23 11:13:34 UTC (rev 8105)
@@ -46,10 +46,9 @@
 
     /**
     @brief
-        This class manages the ball for Pong.
+        This class manages the ball for @ref orxonox::Pong "Pong".
 
-        //TODO: Describe what it's responnsibilities are.
-        Only moves in x-z area.
+        It is responsible for both the movement of the ball in the x,z-plane as well as its interaction with the boundaries of the playing field (defined by the @ref orxonox::PongCenterpoint "PongCenterpoint") and the @ref orxonox::PongBat "PongBats". Or more precisely, it makes the ball bounce off then upper and lower delimiters of the playing field, it makes the ball bounce off the bats and also detects when a player scores and takes appropriate measures.
 
     @author
         Fabian 'x3n' Landau
@@ -64,44 +63,78 @@
 
             virtual void tick(float dt);
 
+            /**
+            @brief Set the dimensions of the playing field.
+            @param width The width of the playing field.
+            @param height The height of the playing field.
+            */
             void setFieldDimension(float width, float height)
                 { this->fieldWidth_ = width; this->fieldHeight_ = height; }
+            /**
+            @brief Get the dimensions of the playing field.
+            @param dimension A vector with the width as the first and height as the second component.
+            */
             void setFieldDimension(const Vector2& dimension)
                 { this->setFieldDimension(dimension.x, dimension.y); }
+            /**
+            @brief Get the dimensions of the playing field.
+            @return Returns a vector with the width as the first and height as the second component.
+            */
             Vector2 getFieldDimension() const
                 { return Vector2(this->fieldWidth_, this->fieldHeight_); }
 
-            void setSpeed(float speed);
+            void setSpeed(float speed); //!< Set the speed of the ball (in x-direction).
+            /**
+            @brief Get the speed of the ball (in x-direction).
+            @return Returns the speed of the ball (in x-direction).
+            */
             float getSpeed() const
                 { return this->speed_; }
 
+            /**
+            @brief Set the acceleration factor of the ball.
+            @param factor The factor the acceleration of the ball is set to.
+            */
             void setAccelerationFactor(float factor)
                 { this->accelerationFactor_ = factor; }
+            /**
+            @brief Get the acceleration factor of the ball.
+            @return Returns the acceleration factor of the ball.
+            */
             float getAccelerationFactor() const
                 { return this->accelerationFactor_; }
 
+            /**
+            @brief Set the length of the bats.
+            @param batlength The length of the bats (in z-direction) as percentage of the height of the playing field.
+            */
             void setBatLength(float batlength)
                 { this->batlength_ = batlength; }
+            /**
+            @brief Get the length of the bats.
+            @return Returns the length of the bats (in z-direction) as percentage of the height of the playing field.
+            */
             float getBatLength() const
                 { return this->batlength_; }
 
-            void setBats(WeakPtr<PongBat>* bats);
-            void applyBats();
+            void setBats(WeakPtr<PongBat>* bats); //!< Set the bats for the ball.
+            void applyBats(); //!< Get the bats over the network.
 
+            // TODO: What is this exactly?
             static const float MAX_REL_Z_VELOCITY;
 
         private:
             void registerVariables();
 
-            float fieldWidth_;
-            float fieldHeight_;
-            float speed_;
-            float accelerationFactor_;
-            float batlength_;
-            WeakPtr<PongBat>* bat_;
-            bool bDeleteBats_;
-            unsigned int* batID_;
-            float relMercyOffset_;
+            float fieldWidth_; //!< The width of the playing field.
+            float fieldHeight_; //!< The height of the playing field.
+            float speed_; //!< The speed (in x-direction) of the ball.
+            float accelerationFactor_; //!< The acceleration factor of the ball.
+            float batlength_; //!< The length of the bats (in z-direction) as percentage of the height of the playing field.
+            WeakPtr<PongBat>* bat_; //!< An array with the two bats.
+            bool bDeleteBats_; //!< Bool, to keep track, of whether bat_ exists or not.
+            unsigned int* batID_; //!< The object IDs of the bats, to be able to synchronize them over the network.
+            float relMercyOffset_; //!< Offset, that makes the player not loose, when, in all fairness, he would have.
     };
 }
 

Modified: code/branches/tetris/src/modules/pong/PongBat.cc
===================================================================
--- code/branches/tetris/src/modules/pong/PongBat.cc	2011-03-23 06:40:36 UTC (rev 8104)
+++ code/branches/tetris/src/modules/pong/PongBat.cc	2011-03-23 11:13:34 UTC (rev 8105)
@@ -26,6 +26,11 @@
  *
  */
 
+/**
+    @file PongBat.cc
+    @brief Implementation of the PongBat class.
+*/
+
 #include "PongBat.h"
 
 #include "core/CoreIncludes.h"
@@ -35,6 +40,10 @@
 {
     CreateFactory(PongBat);
 
+    /**
+    @brief
+        Constructor. Registers and initializes the object.
+    */
     PongBat::PongBat(BaseObject* creator) : ControllableEntity(creator)
     {
         RegisterObject(PongBat);
@@ -49,6 +58,10 @@
         this->registerVariables();
     }
 
+    /**
+    @brief
+        Registers variables to be synchronized over the network.
+    */
     void PongBat::registerVariables()
     {
         registerVariable(this->speed_);
@@ -56,14 +69,24 @@
         registerVariable(this->length_);
     }
 
+    /**
+    @brief
+        Is called each tick.
+        //TODO detailed
+    @param dt
+        The time since last tick.
+    */
     void PongBat::tick(float dt)
     {
+        // If the bat is controlled (but not over the network).
         if (this->hasLocalController())
         {
             if (this->movement_ != 0)
             {
+                // The absolute value of the movement is restricted to be lesser or equal than the speed of the bat.
                 this->movement_ = clamp(this->movement_, -1.0f, 1.0f) * this->speed_;
 
+                //TODO What does this?
                 if (this->bMoveLocal_)
                     this->setVelocity(this->getOrientation() * Vector3(this->movement_, 0, 0));
                 else
@@ -83,6 +106,7 @@
 
         SUPER(PongBat, tick, dt);
 
+        // Restrict the position of the bats, for them to always be between the upper and lower delimiters. i.e. the bats stall if they reach the upper or lower boundary.
         Vector3 position = this->getPosition();
         if (position.z > this->fieldHeight_ / 2 - this->fieldHeight_ * this->length_ / 2)
             position.z = this->fieldHeight_ / 2 - this->fieldHeight_ * this->length_ / 2;
@@ -95,18 +119,34 @@
         }
     }
 
+    /**
+    @brief
+        Overloaded the function to steer the bat up and down.
+    @param value
+        A vector whose first component is the inverse direction in which we want to steer the bat.
+    */
     void PongBat::moveFrontBack(const Vector2& value)
     {
         this->bMoveLocal_ = false;
         this->movement_ = -value.x;
     }
 
+    /**
+    @brief
+        Overloaded the function to steer the bat up and down.
+    @param value
+        A vector whose first component is the direction in which we wnat to steer the bat.
+    */
     void PongBat::moveRightLeft(const Vector2& value)
     {
         this->bMoveLocal_ = true;
         this->movement_ = value.x;
     }
 
+    /**
+    @brief
+        Is called when the player changed.
+    */
     void PongBat::changedPlayer()
     {
         this->setVelocity(0, 0, 0);

Modified: code/branches/tetris/src/modules/pong/PongBat.h
===================================================================
--- code/branches/tetris/src/modules/pong/PongBat.h	2011-03-23 06:40:36 UTC (rev 8104)
+++ code/branches/tetris/src/modules/pong/PongBat.h	2011-03-23 11:13:34 UTC (rev 8105)
@@ -26,51 +26,94 @@
  *
  */
 
+/**
+    @file PongBat.h
+    @brief Declaration of the PongBat class.
+    @ingroup Pong
+*/
+
 #ifndef _PongBat_H__
 #define _PongBat_H__
 
 #include "pong/PongPrereqs.h"
+
 #include "worldentities/ControllableEntity.h"
 
 namespace orxonox
 {
+
+    /**
+    @brief
+        The PongBat class manages the bats for @ref orxonox::Pong "Pong", which are the elements controlled by the player.
+        
+        It is responsible for the movement (controlled by the players) of the bat.
+        
+    @author
+        Fabian 'x3n' Landau
+        
+    @ingroup Pong
+    */
     class _PongExport PongBat : public ControllableEntity
     {
         public:
-            PongBat(BaseObject* creator);
+            PongBat(BaseObject* creator); //!< Constructor. Registers and initializes the object.
             virtual ~PongBat() {}
 
             virtual void tick(float dt);
 
-            virtual void moveFrontBack(const Vector2& value);
-            virtual void moveRightLeft(const Vector2& value);
+            virtual void moveFrontBack(const Vector2& value); //!< Overloaded the function to steer the bat up and down.
+            virtual void moveRightLeft(const Vector2& value); //!< Overloaded the function to steer the bat up and down.
 
-            virtual void changedPlayer();
+            virtual void changedPlayer(); //!< Is called when the player changed.
 
+            /**
+            @brief Set the speed of the bat.
+            @param speed The speed to be set.
+            */
             void setSpeed(float speed)
                 { this->speed_ = speed; }
+            /**
+            @brief Get the speed of the bat.
+            @return Returns the speed of the bat.
+            */
             float getSpeed() const
                 { return this->speed_; }
 
+            /**
+            @brief Set the height of the playing field.
+            @param height The height of the playing field.
+            */
             void setFieldHeight(float height)
                 { this->fieldHeight_ = height; }
+            /**
+            @brief Get the height of the playing field.
+            @return Returns the height of the playing field.
+            */
             float getFieldHeight() const
                 { return this->fieldHeight_; }
 
+            /**
+            @brief Set the length of the bat.
+            @param length The length of the bat (in z-direction) as percentage of the height of the playing field.
+            */
             void setLength(float length)
                 { this->length_ = length; }
+            /**
+            @brief get the length of the bat.
+            @return Returns the length of the bat (in z-direction) as percentage of the height of the playing field.
+            */
             float getLength() const
                 { return this->length_; }
 
         private:
-            void registerVariables();
+            void registerVariables(); //!< Registers variables to be synchronized over the network.
 
-            float movement_;
-            bool bMoveLocal_;
-            float speed_;
-            float length_;
-            float fieldHeight_;
-            bool bSteadiedPosition_;
+            float movement_; //!< The amount (and direction), in z-direction, of movement of the bat.
+            bool bMoveLocal_; //TODO ???
+            float speed_; //!< The movementspeed of the bat.
+            float length_; //!< The length of the bat (in z-direction) as percentage of the height of the playing field.
+            float fieldHeight_; //!< The height of the playing field.
+            bool bSteadiedPosition_; //TODO: ???
     };
 }
 

Modified: code/branches/tetris/src/modules/pong/PongCenterpoint.cc
===================================================================
--- code/branches/tetris/src/modules/pong/PongCenterpoint.cc	2011-03-23 06:40:36 UTC (rev 8104)
+++ code/branches/tetris/src/modules/pong/PongCenterpoint.cc	2011-03-23 11:13:34 UTC (rev 8105)
@@ -26,16 +26,26 @@
  *
  */
 
+/**
+    @file PongCenterpoint.cc
+    @brief Implementation of the PongCenterpoint class.
+*/
+
 #include "PongCenterpoint.h"
 
 #include "core/CoreIncludes.h"
 #include "core/XMLPort.h"
+
 #include "Pong.h"
 
 namespace orxonox
 {
     CreateFactory(PongCenterpoint);
 
+    /**
+    @brief
+        Constructor. Registers and initializes the object and checks whether the gametype is actually Pong.
+    */
     PongCenterpoint::PongCenterpoint(BaseObject* creator) : StaticEntity(creator)
     {
         RegisterObject(PongCenterpoint);
@@ -50,6 +60,10 @@
         this->checkGametype();
     }
 
+    /**
+    @brief
+        Method to create a PongCenterpoint through XML.
+    */
     void PongCenterpoint::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     {
         SUPER(PongCenterpoint, XMLPort, xmlelement, mode);
@@ -63,19 +77,28 @@
         XMLPortParam(PongCenterpoint, "batlength", setBatLength, getBatLength, xmlelement, mode);
     }
 
+    /**
+    @brief
+        Is called when the gametype has changed.
+    */
     void PongCenterpoint::changedGametype()
     {
         SUPER(PongCenterpoint, changedGametype);
 
+        // Check, whether it's still Pong.
         this->checkGametype();
     }
 
+    /**
+    @brief
+        Checks whether the gametype is Pong and if it is, sets its centerpoint.
+    */
     void PongCenterpoint::checkGametype()
     {
-        if (this->getGametype() && this->getGametype()->isA(Class(Pong)))
+        if (this->getGametype() != NULL && this->getGametype()->isA(Class(Pong)))
         {
-            Pong* pong_gametype = orxonox_cast<Pong*>(this->getGametype().get());
-            pong_gametype->setCenterpoint(this);
+            Pong* pongGametype = orxonox_cast<Pong*>(this->getGametype().get());
+            pongGametype->setCenterpoint(this);
         }
     }
 }

Modified: code/branches/tetris/src/modules/pong/PongCenterpoint.h
===================================================================
--- code/branches/tetris/src/modules/pong/PongCenterpoint.h	2011-03-23 06:40:36 UTC (rev 8104)
+++ code/branches/tetris/src/modules/pong/PongCenterpoint.h	2011-03-23 11:13:34 UTC (rev 8105)
@@ -26,75 +26,211 @@
  *
  */
 
+/**
+    @file PongCenterpoint.h
+    @brief Declaration of the PongCenterpoint class.
+    @ingroup Pong
+*/
+
 #ifndef _PongCenterpoint_H__
 #define _PongCenterpoint_H__
 
 #include "pong/PongPrereqs.h"
 
 #include <string>
+
 #include <util/Math.h>
+
 #include "worldentities/StaticEntity.h"
 
 namespace orxonox
 {
+    
+    /**
+    @brief
+        The PongCenterpoint implements the playing field @ref orxonox::Pong "Pong" takes place in and allows for many parameters of the minigame to be set.
+        The playing field resides in the x,z-plane, with the x-axis being the horizontal axis and the z-axis being the vertical axis.
+        
+        Various parameters can be set:
+        - The <b>dimension</b> is a vector, that defines the width and height of the playing field. The default is <em>(200, 120)</em>.
+        - The <b>balltemplate</b> is a template that is applied to the @ref orxonox::PongBall "PongBall", it can be used to attach different things to it, e.g. its @ref orxonox::Model "Model". See below for a usage example.
+        - The <b>battemplate</b> is a template that is applied to the @ref orxonox::PongBall "PongBat", it can be used to attach different things to it, e.g. its @ref orxonox::Model "Model". See below for a usage example.
+        - The <b>ballspeed</b> is the speed with wich the @ref orxonox::PongBall "PongBall" moves. The default is <em>100</em>.
+        - The <b>ballaccfactor</b> is the acceleration factor for the @ref orxonox::PongBall "PongBall". The default is <em>1.0</em>.
+        - The <b>batspeed</b> is the speed with which the @ref orxonox::PongBat "PongBats" move. The default is <em>60</em>.
+        - The <b>batlength</b> is the length of the @ref orxonox::PongBat "PongBats" as the percentage of the height of the playing field. The default is <em>0.25</em>.
+        
+        An example in XML of the PongCenterpoint would be:
+        
+        First the needed templates:
+        The template for the @ref orxonox::PongBall "PongBall".
+        @code
+        <Template name="pongball">
+          <PongBall>
+            <attached>
+              <Model mesh="sphere.mesh" scale="2" />
+              <ParticleSpawner name="hiteffect" position="0,0,0" source="Orxonox/sparks2" lifetime="0.01" autostart="0" mainstate="spawn" />
+            </attached>
+            <eventlisteners>
+              <EventTarget target="hiteffect" />
+            </eventlisteners>
+          </PongBall>
+        </Template>
+        @endcode
+        As can be seen, a sphere is attached as the @ref orxonox::Model "Model" for the @ref orxonox::PongBall "PongBall", and also an @ref orxonox::EventListener "EventListener" that triggers a @ref orxonox::ParticleSpawner "ParticleSpawner", whenever the ball hits the boundaries is attached.
+        
+        Additionally the template for the @ref orxonox::PongBat "PongBat".
+        @code
+        <Template name="pongbatcameras" defaults="0">
+          <PongBat>
+            <camerapositions>
+              <CameraPosition position="0,200,0" pitch="-90" absolute="true" />
+            </camerapositions>
+          </PongBat>
+        </Template>
+
+        <Template name="pongbat">
+          <PongBat camerapositiontemplate=pongbatcameras>
+            <attached>
+              <Model position="0,0,3" mesh="cube.mesh" scale3D="14,2,2" />
+            </attached>
+          </PongBat>
+        </Template>
+        @endcode
+        As can be seen, there are actually two templates. The first template is needed to set the camera for the @ref orxonox::PongBat "PongBat". The second template ist the actual template for the @ref orxonox::PongBat "PongBat", the template for the camera position is added and a @ref orxonox::Model "Model" for the @ref orxonox::PongBat "PongBat" is attached.
+        
+        Finally the PongCenterpoint is created.
+        @code
+        <PongCenterpoint name="pongcenter" dimension="200,120" balltemplate="pongball" battemplate="pongbat" ballspeed="200" ballaccfactor="1.0" batspeed="130" batlength="0.25">
+          <attached>
+            <Model position="0,0,60" mesh="cube.mesh" scale3D="105,1,1" />
+            <Model position="0,0,-60" mesh="cube.mesh" scale3D="105,1,1" />
+          </attached>
+        </PongCenterpoint>
+        @endcode
+        All parameters are specified. And also two @ref orxonox::Model "Models" (for the upper and lower boundary) are attached.
+        
+        For a more elaborate example, have a look at the <code>pong.oxw</code> level file.
+    
+    @author
+        Fabian 'x3n' Landau
+        
+    @ingroup Pong
+    */
     class _PongExport PongCenterpoint : public StaticEntity
     {
         public:
-            PongCenterpoint(BaseObject* creator);
+            PongCenterpoint(BaseObject* creator); //!< Constructor. Registers and initializes the object and checks whether the gametype is actually Pong.
             virtual ~PongCenterpoint() {}
 
-            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method to create a PongCenterpoint through XML.
 
-            virtual void changedGametype();
+            virtual void changedGametype(); //!< Is called when the gametype has changed.
 
+            /**
+            @brief Set the template for the ball. (e.g. to attach the model of the ball, but also to attach an EventListener to it to detect, when it hits the boundaries, and e.g. display some ParticleEffets, when it does.)
+            @param balltemplate The name of the template to be set.
+            */
             void setBalltemplate(const std::string& balltemplate)
                 { this->balltemplate_ = balltemplate; }
+            /**
+            @brief Get the template of the ball.
+            @return Returns the name of the template of the ball. 
+            */
             const std::string& getBalltemplate() const
                 { return this->balltemplate_; }
 
+            /**
+            @brief Set the template for the bats. (e.g. to attach the model of the bat, but also to attach CameraPositions to it, to be able to view the game from the bats perspective)
+            @param battemplate The name of the template to be set.
+            */
             void setBattemplate(const std::string& battemplate)
                 { this->battemplate_ = battemplate; }
+            /**
+            @brief Get the template of the bats.
+            @return Returns the name of the template of the bats.
+            */
             const std::string& getBattemplate() const
                 { return this->battemplate_; }
 
+            /**
+            @brief Set the dimensions of the playing field.
+            @param dimension A vector with the width of the playing field as first component and the height as second.
+            */
             void setFieldDimension(const Vector2& dimension)
                 { this->width_ = dimension.x; this->height_ = dimension.y; }
+            /**
+            @brief Get the dimensions of the playing field.
+            @return Returns a vector with the width of the playing field as first component and the height as second.
+            */
             Vector2 getFieldDimension() const
                 { return Vector2(this->width_, this->height_); }
 
+            /**
+            @brief Set the speed of the ball.
+            @param ballspeed The speed of the ball.
+            */
             void setBallSpeed(float ballspeed)
                 { this->ballspeed_ = ballspeed; }
+            /**
+            @brief Get the speed of the ball.
+            @return Returns the speed of the ball.
+            */
             float getBallSpeed() const
                 { return this->ballspeed_; }
 
+            /**
+            @brief Set the ball's acceleration factor.
+            @param ballaccfactor The ball's acceleration factor.
+            */
             void setBallAccelerationFactor(float ballaccfactor)
                 { this->ballaccfactor_ = ballaccfactor; }
+            /**
+            @brief Get the ball's acceleration factor
+            @return Returns the ball's acceleration factor.
+            */
             float getBallAccelerationFactor() const
                 { return this->ballaccfactor_; }
 
+            /**
+            @brief Set the speed of the bats.
+            @param batspeed The speed of the bats.
+            */
             void setBatSpeed(float batspeed)
                 { this->batspeed_ = batspeed; }
+            /**
+            @brief Get the speed of the bats.
+            @return Returns the speed of the bats.
+            */
             float getBatSpeed() const
                 { return this->batspeed_; }
 
+            /**
+            @brief Set the length of the bats.
+            @param batlength The length of the bats (in z-direction) as a percentage of the height of the playing field.
+            */
             void setBatLength(float batlength)
                 { this->batlength_ = batlength; }
+            /**
+            @brief Get the length of the bats.
+            @return Returns the length of the bats (in z-direction) as a percentage of the height of the playing field.
+            */
             float getBatLength() const
                 { return this->batlength_; }
 
         private:
-            void checkGametype();
+            void checkGametype(); //!< Checks whether the gametype is Pong and if it is, sets its centerpoint.
 
-            std::string balltemplate_;
-            std::string battemplate_;
+            std::string balltemplate_; //!< The template for the ball.
+            std::string battemplate_; //!< The template for the batts.
 
-            float ballspeed_;
-            float ballaccfactor_;
-            float batspeed_;
-            float batlength_;
+            float ballspeed_; //!< The speed of then ball.
+            float ballaccfactor_; //!< The acceleration factor of the ball.
+            float batspeed_; //!< The speed of the bat.
+            float batlength_; //!< The length of the bat (in z-direction) as a percentage of the height of the playing field.
 
-            float width_;
-            float height_;
+            float width_; //!< The height of the playing field.
+            float height_; //!< The width of the playing field.
     };
 }
 




More information about the Orxonox-commit mailing list