summary refs log tree commit diff stats
path: root/src/components/simple_collider.cpp
blob: f4b414e77305502d750b0e4585cab98de39e093c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include "simple_collider.h"

SimpleColliderComponent::SimpleColliderComponent(std::function<void (Game& game, Entity& collider)> callback) : callback(callback)
{
  
}

void SimpleColliderComponent::receive(Game& game, Entity&, const Message& msg)
{
  if (msg.type == Message::Type::collision)
  {
    callback(game, *msg.collisionEntity);
  }
}