Jazz2::Scripting::Legacy::jjBEHAVIOR struct

Holds the behavior assigned to an object: a built-in id, a script function, or a script object.

Tagged-union-style value assigned to jjOBJ::behavior that selects what drives an object each frame: a built-in behavior id, a custom script function, or a script object implementing the behavior interface. Assignment and conversion operators accept each form, and the held function/object reference is reference- counted so it survives as long as the behavior does.

Public static functions

static auto Create(jjBEHAVIOR* self) -> jjBEHAVIOR*
Constructs an empty behavior in place.
static auto CreateFromBehavior(std::uint32_t behavior, jjBEHAVIOR* self) -> jjBEHAVIOR*
Constructs a behavior from a built-in behavior id in place.
static void Destroy(jjBEHAVIOR* self)
Destroys a behavior in place.

Constructors, destructors, conversion operators

~jjBEHAVIOR()
jjBEHAVIOR() defaulted
Creates a new instance.
jjBEHAVIOR(const jjBEHAVIOR& other)
operator std::uint32_t()
operator asIScriptFunction*()
operator asIScriptObject*()

Public functions

auto operator=(const jjBEHAVIOR& other) -> jjBEHAVIOR&
auto operator=(std::uint32_t other) -> jjBEHAVIOR&
auto operator=(asIScriptFunction* other) -> jjBEHAVIOR&
auto operator=(asIScriptObject* other) -> jjBEHAVIOR&
auto operator==(const jjBEHAVIOR& other) const -> bool
auto operator==(std::uint32_t other) const -> bool
auto operator==(const asIScriptFunction* other) const -> bool

Public variables

std::uint32_t behaviorId
asIScriptFunction* function
asIScriptObject* object