Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 23, 2011, 12:13:34 PM (13 years ago)
Author:
dafrick
Message:

More documentation for Pong.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/tetris/src/modules/pong/PongBat.h

    r7163 r8105  
    2727 */
    2828
     29/**
     30    @file PongBat.h
     31    @brief Declaration of the PongBat class.
     32    @ingroup Pong
     33*/
     34
    2935#ifndef _PongBat_H__
    3036#define _PongBat_H__
    3137
    3238#include "pong/PongPrereqs.h"
     39
    3340#include "worldentities/ControllableEntity.h"
    3441
    3542namespace orxonox
    3643{
     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    */
    3756    class _PongExport PongBat : public ControllableEntity
    3857    {
    3958        public:
    40             PongBat(BaseObject* creator);
     59            PongBat(BaseObject* creator); //!< Constructor. Registers and initializes the object.
    4160            virtual ~PongBat() {}
    4261
    4362            virtual void tick(float dt);
    4463
    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.
    4766
    48             virtual void changedPlayer();
     67            virtual void changedPlayer(); //!< Is called when the player changed.
    4968
     69            /**
     70            @brief Set the speed of the bat.
     71            @param speed The speed to be set.
     72            */
    5073            void setSpeed(float speed)
    5174                { this->speed_ = speed; }
     75            /**
     76            @brief Get the speed of the bat.
     77            @return Returns the speed of the bat.
     78            */
    5279            float getSpeed() const
    5380                { return this->speed_; }
    5481
     82            /**
     83            @brief Set the height of the playing field.
     84            @param height The height of the playing field.
     85            */
    5586            void setFieldHeight(float height)
    5687                { this->fieldHeight_ = height; }
     88            /**
     89            @brief Get the height of the playing field.
     90            @return Returns the height of the playing field.
     91            */
    5792            float getFieldHeight() const
    5893                { return this->fieldHeight_; }
    5994
     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            */
    6099            void setLength(float length)
    61100                { 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            */
    62105            float getLength() const
    63106                { return this->length_; }
    64107
    65108        private:
    66             void registerVariables();
     109            void registerVariables(); //!< Registers variables to be synchronized over the network.
    67110
    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: ???
    74117    };
    75118}
Note: See TracChangeset for help on using the changeset viewer.