Changeset 8105 for code/branches/tetris/src/modules/pong/PongCenterpoint.cc
- Timestamp:
- Mar 23, 2011, 12:13:34 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/tetris/src/modules/pong/PongCenterpoint.cc
r5929 r8105 27 27 */ 28 28 29 /** 30 @file PongCenterpoint.cc 31 @brief Implementation of the PongCenterpoint class. 32 */ 33 29 34 #include "PongCenterpoint.h" 30 35 31 36 #include "core/CoreIncludes.h" 32 37 #include "core/XMLPort.h" 38 33 39 #include "Pong.h" 34 40 … … 37 43 CreateFactory(PongCenterpoint); 38 44 45 /** 46 @brief 47 Constructor. Registers and initializes the object and checks whether the gametype is actually Pong. 48 */ 39 49 PongCenterpoint::PongCenterpoint(BaseObject* creator) : StaticEntity(creator) 40 50 { … … 51 61 } 52 62 63 /** 64 @brief 65 Method to create a PongCenterpoint through XML. 66 */ 53 67 void PongCenterpoint::XMLPort(Element& xmlelement, XMLPort::Mode mode) 54 68 { … … 64 78 } 65 79 80 /** 81 @brief 82 Is called when the gametype has changed. 83 */ 66 84 void PongCenterpoint::changedGametype() 67 85 { 68 86 SUPER(PongCenterpoint, changedGametype); 69 87 88 // Check, whether it's still Pong. 70 89 this->checkGametype(); 71 90 } 72 91 92 /** 93 @brief 94 Checks whether the gametype is Pong and if it is, sets its centerpoint. 95 */ 73 96 void PongCenterpoint::checkGametype() 74 97 { 75 if (this->getGametype() && this->getGametype()->isA(Class(Pong)))98 if (this->getGametype() != NULL && this->getGametype()->isA(Class(Pong))) 76 99 { 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); 79 102 } 80 103 }
Note: See TracChangeset
for help on using the changeset viewer.