2016-03-25 18:15:51 +00:00
|
|
|
#ifndef __PTF_COLLISION_HPP__
|
|
|
|
#define __PTF_COLLISION_HPP__
|
|
|
|
|
|
|
|
#include "object.hpp"
|
2016-03-28 00:03:56 +00:00
|
|
|
#include "collision_data.hpp"
|
2016-03-25 18:15:51 +00:00
|
|
|
#include <SFML/Graphics.hpp>
|
|
|
|
#include <utility>
|
|
|
|
|
|
|
|
namespace Collision {
|
2016-03-28 00:03:56 +00:00
|
|
|
typedef bool (*collision_detect)(CollisionData&);
|
|
|
|
typedef std::map<std::pair<unsigned int, unsigned int>, collision_detect> collision_dispatcher;
|
2016-03-25 18:15:51 +00:00
|
|
|
extern collision_dispatcher dispatch;
|
|
|
|
|
2016-03-28 00:03:56 +00:00
|
|
|
bool playerToBlock(CollisionData& data);
|
|
|
|
bool blockToPlayer(CollisionData& data);
|
|
|
|
bool playerToPlayer(CollisionData& data);
|
|
|
|
bool blockToBlock(CollisionData& data);
|
2016-03-25 18:15:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|