63 uintptr_t callbackPointerData = 0);
73 uintptr_t callbackPointerData = 0);
167 uintptr_t mCallbackPointerData;
int32_t EventID
Numeric identifier for an event. -1 is uninitialized, IDs < -1 are internally registered,...
Definition EventTypes.h:8
Represents a discrete, repeatable operation run by a Tickable.
Definition Action.h:35
Action specialization for event-driven dispatch.
Definition EventAction.h:46
bool HasCallback() const
Returns true when a callback override is configured.
EventAction & SetCallback(uintptr_t callback, uintptr_t callbackPointerData)
Configures a C-style callback override.
bool ActionRan() override
Dispatches callback override when present, else delegates to TickableComponent::ActionRan().
EventAction(EventID eventId, std::shared_ptr< Tickable > tickable)
Constructs an EventAction for the given EventID.
EventAction & SetCallback(const EventActionCallback &callback, uintptr_t callbackPointerData)
Configures callback override from callback variant.
EventAction(EventID eventId, std::shared_ptr< Tickable > tickable, EventActionCppCallback callback, uintptr_t callbackPointerData=0)
Constructs an EventAction with a C++ callback override.
EventAction & SetCallback(EventActionCppCallback callback, uintptr_t callbackPointerData)
Configures a C++ callback override.
EventAction & SetCallback(uintptr_t callback)
Configures a C-style callback override.
bool GetHasCppCallback() const
Returns true when callback target is the C++ callback form.
EventAction & SetCallback(const EventActionCallback &callback)
Configures callback override from callback variant.
virtual ~EventAction()=default
EventAction & ClearCallback()
Clears callback override and restores fallback dispatch.
uintptr_t GetCallbackPointerData() const
Returns the callback pointer-sized data used by both callback forms.
EventAction(EventID eventId, std::shared_ptr< Tickable > tickable, uintptr_t callback, uintptr_t callbackPointerData=0)
Constructs an EventAction with a C-style callback override.
bool GetHasRawCallback() const
Returns true when callback target is the raw function-pointer form.
const EventActionCallback & GetCallback() const
Returns the currently configured callback target.
EventID GetEventId() const
Returns the EventID this action corresponds to.
EventAction & SetCallback(EventActionCppCallback callback)
Configures a C++ callback override.
EventAction & SetCallbackPointerData(uintptr_t callbackPointerData)
Updates callback pointer-sized data without changing callback target.
Core namespace for the libultraship engine framework.
Definition gfx_direct3d_common.h:14
std::function< bool(EventID, uintptr_t)> EventActionCppCallback
C++ callback signature for EventAction dispatch.
Definition EventAction.h:19
bool(*)(EventID, uintptr_t) EventActionRawCallback
C-style callback signature for EventAction dispatch.
Definition EventAction.h:26
std::variant< std::monostate, EventActionCppCallback, uintptr_t > EventActionCallback
Stored callback target for EventAction.
Definition EventAction.h:35