Object* Level::PickUp(const float x, const float y) { Object* temp; for(std::vector::iterator obj = this -> objects.begin(); obj != this -> objects.end(); ++obj ); { temp = *obj; if( temp != NULL && temp -> Grabbable() && temp -> PointInside( x , y ) ) { this -> objects.erase(obj); return temp; } } return NULL; }