Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 6, 2011, 12:07:29 PM (13 years ago)
Author:
dafrick
Message:

Merging trunk into dockingsystem branch to be able to use the recent bugfix in MultiTrigger.

Location:
code/branches/dockingsystem
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/dockingsystem

  • code/branches/dockingsystem/src/modules/pong/Pong.h

    r7911 r8194  
    2727 */
    2828
     29/**
     30    @file Pong.h
     31    @brief Declaration of the Pong class.
     32    @ingroup Pong
     33*/
     34
    2935#ifndef _Pong_H__
    3036#define _Pong_H__
     
    3339
    3440#include "tools/Timer.h"
     41
    3542#include "gametypes/Deathmatch.h"
    3643
    3744namespace orxonox
    3845{
     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    */
    3963    class _PongExport Pong : public Deathmatch
    4064    {
    4165        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.
    4468
    45             virtual void start();
    46             virtual void end();
     69            virtual void start(); //!< Starts the Pong minigame.
     70            virtual void end(); ///!< Ends the Pong minigame.
    4771
    48             virtual void spawnPlayer(PlayerInfo* player);
     72            virtual void spawnPlayer(PlayerInfo* player); //!< Spawns the input player.
    4973
    50             virtual void playerScored(PlayerInfo* player);
     74            virtual void playerScored(PlayerInfo* player); //!< Is called when the player scored.
    5175
     76            /**
     77            @brief Set the PongCenterpoint (the playing field).
     78            @param center A pointer to the PongCenterpoint to be set.
     79            */
    5280            void setCenterpoint(PongCenterpoint* center)
    5381                { this->center_ = center; }
    5482
    55             PlayerInfo* getLeftPlayer() const;
    56             PlayerInfo* getRightPlayer() const;
     83            PlayerInfo* getLeftPlayer() const; //!< Get the left player.
     84            PlayerInfo* getRightPlayer() const; //!< Get the right player.
    5785
    5886        protected:
    59             virtual void spawnPlayersIfRequested();
     87            virtual void spawnPlayersIfRequested(); //!< Spawns players, and fills the rest up with bots.
    6088
    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.
    6391
    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.
    6896    };
    6997}
Note: See TracChangeset for help on using the changeset viewer.