mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-06-06 03:12:01 +00:00
adding on collided callback
This commit is contained in:
@@ -16,27 +16,38 @@ namespace BBM
|
||||
return new CollisionComponent(entity);
|
||||
}
|
||||
|
||||
CollisionComponent::CollisionComponent(WAL::Entity &entity, std::function<void (WAL::Entity &, const WAL::Entity &)> callback, Vector3f bound)
|
||||
: WAL::Component(entity), onCollide(callback), bound(bound)
|
||||
CollisionComponent::CollisionComponent(WAL::Entity &entity, std::function<void (WAL::Entity &, const WAL::Entity &)> onCollide, std::function<void (WAL::Entity &, const WAL::Entity &)> onCollided, Vector3f bound)
|
||||
: WAL::Component(entity), _onCollide(onCollide), _onCollided(onCollided), bound(bound)
|
||||
{ }
|
||||
|
||||
CollisionComponent::CollisionComponent(WAL::Entity &entity, std::function<void (WAL::Entity &, const WAL::Entity &)> callback, float boundSize)
|
||||
: WAL::Component(entity), onCollide(callback), bound({boundSize, boundSize, boundSize})
|
||||
CollisionComponent::CollisionComponent(WAL::Entity &entity, std::function<void (WAL::Entity &, const WAL::Entity &)> onCollide, std::function<void (WAL::Entity &, const WAL::Entity &)> onCollided, float boundSize)
|
||||
: WAL::Component(entity), _onCollide(onCollide), _onCollided(onCollided), bound({boundSize, boundSize, boundSize})
|
||||
{ }
|
||||
|
||||
CollisionComponent::CollisionComponent(WAL::Entity &entity, WAL::Callback<WAL::Entity &, const WAL::Entity &> callback, Vector3f bound)
|
||||
: WAL::Component(entity), onCollide(callback), bound(bound)
|
||||
CollisionComponent::CollisionComponent(WAL::Entity &entity, WAL::Callback<WAL::Entity &, const WAL::Entity &> onCollide, WAL::Callback<WAL::Entity &, const WAL::Entity &> onCollided, Vector3f bound)
|
||||
: WAL::Component(entity), _onCollide(onCollide), _onCollided(onCollided), bound(bound)
|
||||
{ }
|
||||
|
||||
CollisionComponent::CollisionComponent(WAL::Entity &entity, WAL::Callback<WAL::Entity &, const WAL::Entity &> callback, float boundSize)
|
||||
: WAL::Component(entity), onCollide(callback), bound({boundSize, boundSize, boundSize})
|
||||
CollisionComponent::CollisionComponent(WAL::Entity &entity, WAL::Callback<WAL::Entity &, const WAL::Entity &> onCollide, WAL::Callback<WAL::Entity &, const WAL::Entity &> onCollided, float boundSize)
|
||||
: WAL::Component(entity), _onCollide(onCollide), _onCollided(onCollided), bound({boundSize, boundSize, boundSize})
|
||||
{ }
|
||||
|
||||
CollisionComponent::CollisionComponent(WAL::Entity &entity, Vector3f bound)
|
||||
: WAL::Component(entity), onCollide(), bound(bound)
|
||||
: WAL::Component(entity), _onCollide(), _onCollided(), bound(bound)
|
||||
{ }
|
||||
|
||||
CollisionComponent::CollisionComponent(WAL::Entity &entity, float boundSize)
|
||||
: WAL::Component(entity), onCollide(), bound({boundSize, boundSize, boundSize})
|
||||
: WAL::Component(entity), _onCollide(), _onCollided(), bound({boundSize, boundSize, boundSize})
|
||||
{ }
|
||||
|
||||
const WAL::Callback<WAL::Entity &, const WAL::Entity &> &CollisionComponent::getOnCollide(void) const
|
||||
{
|
||||
return _onCollide;
|
||||
}
|
||||
|
||||
const WAL::Callback<WAL::Entity &, const WAL::Entity &> &CollisionComponent::getOnCollided(void) const
|
||||
{
|
||||
return _onCollided;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user