SDLPP: allow using shared pointers when adding collisions

This commit is contained in:
zv0n 2021-05-25 22:04:38 +02:00
parent bd8a841e6f
commit 79d5f348c4

View File

@ -49,6 +49,12 @@ public:
collisionWidth(), collisionHeight(),
getId() );
}
template < class T > void addCollision( const std::shared_ptr< T > &p ) {
collisions.push_back( p );
collisions.back()->updateCollision( collisionPushX(), collisionPushY(),
collisionWidth(), collisionHeight(),
getId() );
}
bool hasCollisions() const;
const std::vector< std::shared_ptr< CollisionPolygon > > &
getCollisions() const;