1 #ifndef RADIX_COMPONENT_TRIGGER_HPP
2 #define RADIX_COMPONENT_TRIGGER_HPP
11 #include <BulletCollision/CollisionShapes/btCapsuleShape.h>
12 #include <bullet/BulletCollision/CollisionDispatch/btGhostObject.h>
21 using Action = std::function<void(BaseGame*)>;
30 std::shared_ptr<btConvexShape>
shape;
45 return Component::getTypeId<std::remove_reference<decltype(*this)>::type>();
void setActionOnMove(Action action)
Definition: Trigger.cpp:50
Definition: GameController.hpp:7
std::shared_ptr< btConvexShape > shape
Definition: Trigger.hpp:30
Action actionOnUpdate
Definition: Trigger.hpp:26
void setActionOnEnter(Action action)
Definition: Trigger.cpp:46
ECS entity, Component container It is created like this:
Definition: Entity.hpp:23
void onUpdate(BaseGame *game)
Definition: Trigger.hpp:54
std::function< void(BaseGame *)> Action
Definition: Trigger.hpp:21
Trigger(Entity &ent)
Definition: Trigger.cpp:6
Action actionOnMove
Definition: Trigger.hpp:25
void serialize(serine::Archiver &ar)
Definition: Trigger.hpp:48
TypeId getTypeId() const
Definition: Trigger.hpp:44
const char * getName() const
Definition: Trigger.hpp:35
Base class to create entity components.
Definition: Component.hpp:25
void onEnter(BaseGame *game)
Definition: Trigger.hpp:51
EventDispatcher::CallbackHolder callbackOnEnter
Definition: Trigger.hpp:28
btGhostObject * getBulletGhostObject()
Definition: Trigger.cpp:42
ComponentTypeId TypeId
Definition: Component.hpp:35
Action actionOnExit
Definition: Trigger.hpp:24
~Trigger()
Definition: Trigger.cpp:62
void setActionOnUpdate(Action action)
Definition: Trigger.cpp:54
void onMove(BaseGame *game)
Definition: Trigger.hpp:53
void setActionOnExit(Action action)
Definition: Trigger.cpp:58
Definition: EventDispatcher.hpp:20
Action actionOnEnter
Definition: Trigger.hpp:23
Definition: BaseGame.hpp:22
btGhostObject * ghostObject
Definition: Trigger.hpp:18
EventDispatcher::CallbackHolder callbackOnExit
Definition: Trigger.hpp:28
void onExit(BaseGame *game)
Definition: Trigger.hpp:52
Definition: Trigger.hpp:16