* Animates explosion sprites. If their animation is finished remove them from the list. * If the list is empty, this state is finished and the actual calculations take place. */
| 172 | * If the list is empty, this state is finished and the actual calculations take place. |
| 173 | */ |
| 174 | void ExplosionBState::think() |
| 175 | { |
| 176 | for (std::list<Explosion*>::iterator i = _parent->getMap()->getExplosions()->begin(); i != _parent->getMap()->getExplosions()->end();) |
| 177 | { |
| 178 | if(!(*i)->animate()) |
| 179 | { |
| 180 | delete (*i); |
| 181 | i = _parent->getMap()->getExplosions()->erase(i); |
| 182 | if (_parent->getMap()->getExplosions()->empty()) |
| 183 | { |
| 184 | explode(); |
| 185 | return; |
| 186 | } |
| 187 | } |
| 188 | else |
| 189 | { |
| 190 | ++i; |
| 191 | } |
| 192 | } |
| 193 | } |
| 194 | |
| 195 | /** |
| 196 | * Explosions cannot be cancelled. |
nothing calls this directly
no test coverage detected