|
Toast Engine
|
Polymorphic base for all triggers. More...
#include <trigger.hpp>

Classes | |
| struct | Result |
| Outcome of evaluating a trigger for one frame. More... | |
Public Member Functions | |
| ITrigger (const ITrigger &)=default | |
| auto | operator= (const ITrigger &) -> ITrigger &=default |
| virtual auto | evaluate (const InputSample &sample, const EvalContext &ctx) -> Result=0 |
| Evaluates the trigger against the current input sample. | |
| virtual auto | name () const -> std::string_view=0 |
Static Public Member Functions | |
| static auto | fromToml (const toml::table &table, ValueType vt) -> std::shared_ptr< ITrigger > |
| Builds a trigger from a TOML table keyed by its "name" field. | |
Polymorphic base for all triggers.
|
pure virtual |
Evaluates the trigger against the current input sample.
| sample | Raw input for the bound keycode this frame |
| ctx | Frame context including delta time and viewport metrics |
Implemented in input::Axis1DTrigger, input::Axis2DTrigger, input::CursorTrigger, input::HoldTrigger, input::PulseTrigger, input::ReleaseTrigger, and input::StartTrigger.
|
static |
Builds a trigger from a TOML table keyed by its "name" field.
| table | The [[trigger]] table |
| vt | The value domain of the owning action, used to coerce value fields |
