summary refs log tree commit diff stats
path: root/src/components/simple_collider.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/simple_collider.cpp')
-rw-r--r--src/components/simple_collider.cpp14
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
3SimpleColliderComponent::SimpleColliderComponent(std::function<void (Game& game, Entity& collider)> callback) : callback(callback)
4{
5
6}
7
8void SimpleColliderComponent::receive(Game& game, Entity&, const Message& msg)
9{
10 if (msg.type == Message::Type::collision)
11 {
12 callback(game, *msg.collisionEntity);
13 }
14}