Changeset 11054 for code/branches/cpp11_v3/src/modules/pong/PongAI.cc
- Timestamp:
- Jan 10, 2016, 1:54:11 PM (9 years ago)
- Location:
- code/branches/cpp11_v3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v3
- Property svn:mergeinfo changed
-
code/branches/cpp11_v3/src/modules/pong/PongAI.cc
r11018 r11054 57 57 RegisterObject(PongAI); 58 58 59 this->ball_ = 0;59 this->ball_ = nullptr; 60 60 this->ballDirection_ = Vector2::ZERO; 61 61 this->ballEndPosition_ = 0; … … 77 77 PongAI::~PongAI() 78 78 { 79 for (std:: list<std::pair<Timer*, char> >::iterator it = this->reactionTimers_.begin(); it != this->reactionTimers_.end(); ++it)80 delete it->first;79 for (std::pair<Timer*, char>& pair : this->reactionTimers_) 80 delete pair.first; 81 81 } 82 82 … … 101 101 { 102 102 // If either the ball, or the controllable entity (i.e. the bat) don't exist (or aren't set). 103 if (this->ball_ == NULL || this->getControllableEntity() == NULL)103 if (this->ball_ == nullptr || this->getControllableEntity() == nullptr) 104 104 return; 105 105 … … 362 362 // Add a new Timer 363 363 Timer* timer = new Timer(delay, false, createExecutor(createFunctor(&PongAI::delayedMove, this))); 364 this->reactionTimers_. push_back(std::pair<Timer*, char>(timer, direction));364 this->reactionTimers_.emplace_back(timer, direction); 365 365 } 366 366 else
Note: See TracChangeset
for help on using the changeset viewer.