diff options
Diffstat (limited to 'src/components/simple_collider.cpp')
| -rw-r--r-- | src/components/simple_collider.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
| diff --git a/src/components/simple_collider.cpp b/src/components/simple_collider.cpp new file mode 100644 index 0000000..f4b414e --- /dev/null +++ b/src/components/simple_collider.cpp | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | #include "simple_collider.h" | ||
| 2 | |||
| 3 | SimpleColliderComponent::SimpleColliderComponent(std::function<void (Game& game, Entity& collider)> callback) : callback(callback) | ||
| 4 | { | ||
| 5 | |||
| 6 | } | ||
| 7 | |||
| 8 | void SimpleColliderComponent::receive(Game& game, Entity&, const Message& msg) | ||
| 9 | { | ||
| 10 | if (msg.type == Message::Type::collision) | ||
| 11 | { | ||
| 12 | callback(game, *msg.collisionEntity); | ||
| 13 | } | ||
| 14 | } | ||
