Changeset 11071 for code/trunk/src/modules/dodgerace
- Timestamp:
- Jan 17, 2016, 10:29:21 PM (9 years ago)
- Location:
- code/trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/modules/dodgerace/DodgeRace.cc
r11052 r11071 59 59 comboTimer.setTimer(3.0f, true, createExecutor(createFunctor(&DodgeRace::comboControll, this))); 60 60 this->numberOfBots_ = 0; //sets number of default bots temporarly to 0 61 this->center_ = 0;61 this->center_ = nullptr; 62 62 63 63 this->setHUDTemplate("DodgeRaceHUD"); … … 67 67 { 68 68 level++; 69 if (getPlayer() != NULL)69 if (getPlayer() != nullptr) 70 70 { 71 71 for (int i = 0; i < 7; i++) … … 89 89 void DodgeRace::tick(float dt) 90 90 { 91 if (getPlayer() != NULL)91 if (getPlayer() != nullptr) 92 92 { 93 93 currentPosition = getPlayer()->getWorldPosition().x; … … 138 138 DodgeRaceShip* DodgeRace::getPlayer() 139 139 { 140 if (player == NULL)141 { 142 for ( ObjectList<DodgeRaceShip>::iterator it = ObjectList<DodgeRaceShip>::begin(); it != ObjectList<DodgeRaceShip>::end(); ++it)143 { 144 player = *it;140 if (player == nullptr) 141 { 142 for (DodgeRaceShip* ship : ObjectList<DodgeRaceShip>()) 143 { 144 player = ship; 145 145 } 146 146 } … … 177 177 this->bForceSpawn_ = false; 178 178 179 if (this->center_ == NULL) // abandon mission!179 if (this->center_ == nullptr) // abandon mission! 180 180 { 181 181 orxout(internal_error) << "DodgeRace: No Centerpoint specified." << endl; -
code/trunk/src/modules/dodgerace/DodgeRace.h
r11052 r11071 68 68 DodgeRace(Context* context); 69 69 70 virtual void start() ;71 virtual void end() ;70 virtual void start() override; 71 virtual void end() override; 72 72 73 virtual void tick(float dt) ;73 virtual void tick(float dt) override; 74 74 75 virtual void playerPreSpawn(PlayerInfo* player) ;75 virtual void playerPreSpawn(PlayerInfo* player) override; 76 76 77 77 void levelUp(); … … 84 84 void setCenterpoint(DodgeRaceCenterPoint* center) 85 85 { this->center_ = center; } 86 virtual void addBots(unsigned int amount) {} //<! overwrite function in order to bypass the addbots command86 virtual void addBots(unsigned int amount) override{} //<! overwrite function in order to bypass the addbots command 87 87 88 88 // checks if multiplier should be reset. -
code/trunk/src/modules/dodgerace/DodgeRaceCenterPoint.cc
r10624 r11071 49 49 } 50 50 51 void DodgeRaceCenterPoint::XMLPort(Element& xmlelement, XMLPort::Mode mode)52 {53 SUPER(DodgeRaceCenterPoint, XMLPort, xmlelement, mode);54 }55 56 51 void DodgeRaceCenterPoint::checkGametype() 57 52 { 58 if (this->getGametype() != NULL&& this->getGametype()->isA(Class(DodgeRace)))53 if (this->getGametype() != nullptr && this->getGametype()->isA(Class(DodgeRace))) 59 54 { 60 55 DodgeRace* DodgeRaceGametype = orxonox_cast<DodgeRace*>(this->getGametype()); -
code/trunk/src/modules/dodgerace/DodgeRaceCenterPoint.h
r10624 r11071 50 50 DodgeRaceCenterPoint(Context* context); //checks whether the gametype is actually DodgeRace. 51 51 52 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);53 54 52 private: 55 53 void checkGametype(); -
code/trunk/src/modules/dodgerace/DodgeRaceHUDinfo.cc
r10624 r11071 40 40 RegisterObject(DodgeRaceHUDinfo); 41 41 42 this->DodgeRaceGame = 0;42 this->DodgeRaceGame = nullptr; 43 43 this->bShowPoints_ = true; 44 44 } … … 86 86 else 87 87 { 88 this->DodgeRaceGame = 0;88 this->DodgeRaceGame = nullptr; 89 89 } 90 90 } -
code/trunk/src/modules/dodgerace/DodgeRaceHUDinfo.h
r10234 r11071 44 44 DodgeRaceHUDinfo(Context* context); 45 45 46 virtual void tick(float dt) ;47 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;48 virtual void changedOwner() ;46 virtual void tick(float dt) override; 47 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 48 virtual void changedOwner() override; 49 49 50 50 inline void setShowPoints(bool value) -
code/trunk/src/modules/dodgerace/DodgeRaceShip.cc
r10624 r11071 91 91 // Camera 92 92 Camera* camera = this->getCamera(); 93 if (camera != NULL)93 if (camera != nullptr) 94 94 { 95 95 // camera->setPosition(Vector3(-pos.z, -posforeward, 0)); … … 142 142 } 143 143 144 inline bool DodgeRaceShip::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)144 inline bool DodgeRaceShip::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) 145 145 { 146 146 … … 152 152 DodgeRace* DodgeRaceShip::getGame() 153 153 { 154 if (game == NULL)154 if (game == nullptr) 155 155 { 156 for ( ObjectList<DodgeRace>::iterator it = ObjectList<DodgeRace>::begin(); it != ObjectList<DodgeRace>::end(); ++it)156 for (DodgeRace* race : ObjectList<DodgeRace>()) 157 157 { 158 game = *it;158 game = race; 159 159 } 160 160 } -
code/trunk/src/modules/dodgerace/DodgeRaceShip.h
r10624 r11071 52 52 DodgeRaceShip(Context* context); 53 53 54 virtual void tick(float dt) ;54 virtual void tick(float dt) override; 55 55 56 56 // overwrite for 2d movement 57 virtual void moveFrontBack(const Vector2& value) ;58 virtual void moveRightLeft(const Vector2& value) ;57 virtual void moveFrontBack(const Vector2& value) override; 58 virtual void moveRightLeft(const Vector2& value) override; 59 59 60 60 // Starts or stops fireing 61 virtual void boost(bool bBoost) ;61 virtual void boost(bool bBoost) override; 62 62 63 63 //no rotation! 64 virtual void rotateYaw(const Vector2& value) {};65 virtual void rotatePitch(const Vector2& value) {};64 virtual void rotateYaw(const Vector2& value) override{}; 65 virtual void rotatePitch(const Vector2& value) override{}; 66 66 67 67 //return to main menu if game has ended. 68 virtual void rotateRoll(const Vector2& value) {if (getGame()) if (getGame()->bEndGame) getGame()->end();};68 virtual void rotateRoll(const Vector2& value) override{if (getGame()) if (getGame()->bEndGame) getGame()->end();}; 69 69 70 70 virtual void updateLevel(); 71 72 virtual inline bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override; 71 73 72 74 float speed, damping, posforeward; … … 74 76 75 77 protected: 76 virtual void death() ;78 virtual void death() override; 77 79 78 80 private: 79 virtual inline bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);80 81 DodgeRace* getGame(); 81 82 WeakPtr<DodgeRace> game;
Note: See TracChangeset
for help on using the changeset viewer.