Changeset 7911 for code/trunk/src/modules/pong
- Timestamp:
- Feb 18, 2011, 12:08:00 AM (14 years ago)
- Location:
- code/trunk/src/modules/pong
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/pong/Pong.cc
r7865 r7911 60 60 61 61 this->botclass_ = Class(PongBot); 62 } 63 64 Pong::~Pong() 65 { 66 if (this->isInitialized()) 67 this->cleanup(); 68 } 69 70 void Pong::cleanup() 71 { 72 if (this->ball_) 73 { 74 this->ball_->destroy(); 75 this->ball_ = 0; 76 } 77 78 for (size_t i = 0; i < 2; ++i) 79 { 80 if (this->bat_[0]) 81 { 82 this->bat_[0]->destroy(); 83 this->bat_[0] = 0; 84 } 85 } 62 86 } 63 87 … … 123 147 void Pong::end() 124 148 { 125 if (this->ball_) 126 { 127 this->ball_->destroy(); 128 this->ball_ = 0; 129 } 149 this->cleanup(); 130 150 131 151 Deathmatch::end(); -
code/trunk/src/modules/pong/Pong.h
r7865 r7911 41 41 public: 42 42 Pong(BaseObject* creator); 43 virtual ~Pong() {}43 virtual ~Pong(); 44 44 45 45 virtual void start(); … … 60 60 61 61 void startBall(); 62 void cleanup(); 62 63 63 64 WeakPtr<PongCenterpoint> center_;
Note: See TracChangeset
for help on using the changeset viewer.