SDLPP: allow using shared pointers when adding collisions
This commit is contained in:
parent
bd8a841e6f
commit
79d5f348c4
@ -49,6 +49,12 @@ public:
|
|||||||
collisionWidth(), collisionHeight(),
|
collisionWidth(), collisionHeight(),
|
||||||
getId() );
|
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;
|
bool hasCollisions() const;
|
||||||
const std::vector< std::shared_ptr< CollisionPolygon > > &
|
const std::vector< std::shared_ptr< CollisionPolygon > > &
|
||||||
getCollisions() const;
|
getCollisions() const;
|
||||||
|
Loading…
Reference in New Issue
Block a user