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/PongCenterpoint.cc

    r5929 r8105  
    2727 */
    2828
     29/**
     30    @file PongCenterpoint.cc
     31    @brief Implementation of the PongCenterpoint class.
     32*/
     33
    2934#include "PongCenterpoint.h"
    3035
    3136#include "core/CoreIncludes.h"
    3237#include "core/XMLPort.h"
     38
    3339#include "Pong.h"
    3440
     
    3743    CreateFactory(PongCenterpoint);
    3844
     45    /**
     46    @brief
     47        Constructor. Registers and initializes the object and checks whether the gametype is actually Pong.
     48    */
    3949    PongCenterpoint::PongCenterpoint(BaseObject* creator) : StaticEntity(creator)
    4050    {
     
    5161    }
    5262
     63    /**
     64    @brief
     65        Method to create a PongCenterpoint through XML.
     66    */
    5367    void PongCenterpoint::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    5468    {
     
    6478    }
    6579
     80    /**
     81    @brief
     82        Is called when the gametype has changed.
     83    */
    6684    void PongCenterpoint::changedGametype()
    6785    {
    6886        SUPER(PongCenterpoint, changedGametype);
    6987
     88        // Check, whether it's still Pong.
    7089        this->checkGametype();
    7190    }
    7291
     92    /**
     93    @brief
     94        Checks whether the gametype is Pong and if it is, sets its centerpoint.
     95    */
    7396    void PongCenterpoint::checkGametype()
    7497    {
    75         if (this->getGametype() && this->getGametype()->isA(Class(Pong)))
     98        if (this->getGametype() != NULL && this->getGametype()->isA(Class(Pong)))
    7699        {
    77             Pong* pong_gametype = orxonox_cast<Pong*>(this->getGametype().get());
    78             pong_gametype->setCenterpoint(this);
     100            Pong* pongGametype = orxonox_cast<Pong*>(this->getGametype().get());
     101            pongGametype->setCenterpoint(this);
    79102        }
    80103    }
Note: See TracChangeset for help on using the changeset viewer.