Engine → Scripting → script_runtime.h
script_runtime¶
| Type | Class |
| Namespace | conjure::scripting |
| Include File Path | engine/include/conjure/scripting/script_runtime.h |
| Source File Path | engine/src/scripting/script_runtime.cpp |
| API ↗ | Scripting, Scripts, components and the runtime |
Syntax¶
Constructors¶
| Access | Signature | Description |
|---|---|---|
| public | explicit script_runtime(
std::unique_ptr<script_host> host); |
Important
Copy constructor and assignment has been deleted.
Destructors¶
| Access | Signature | Description |
|---|---|---|
| public | ~script_runtime(); | destroy_all(false) when instances are still alive, then shuts the host down. |
Variables¶
| Access | Name | Type | Default | Description |
|---|---|---|---|---|
| private | m | std::vector<ecs::entity> | {} | |
| private | m | std:: | {} | |
| private | m | std::vector<ecs::entity> | {} | |
| private | m | std::vector<i32> | {} | |
| private | m | std::vector<i32> | {} | |
| private | m | core:: | {} | |
| private | m | ecs::observer_id | {} | |
| private | m | bool | false | |
| private | m | std::filesystem::path | {} | |
| public | MAX_ | static constexpr u32 | 8 | Loops flush_pending() runs for creates and destroys requested from inside OnCreate/OnDestroy. |
| private | mBlobBuffer | std::vector<u8> | {} | |
| private | m | u16 | 0 | |
| private | mClasses | script_class_registry | {} | |
| private | m | std:: | {} | |
| private | m | std:: | {} | |
| private | m | bool | false | |
| private | m | script_phase | script_ | |
| private | m | std:: | nullptr | |
| private | m | core:: | {} | |
| private | m | ecs::observer_id | {} | |
| private | mEntityNames | std:: | {} | |
| private | m | std:: | {} | |
| private | mFrameBlock | std:: | nullptr | |
| private | m | std:: | {} | |
| private | m | bool | false | |
| private | mHost | std:: | nullptr | |
| private | mInFlush | bool | false | |
| private | m | conjure_managed_memory | {} | |
| private | mMode | script_mode | script_ | |
| private | mNativeApi | conjure_native_api | {} | |
| private | mNextScopeId | u32 | 1 | |
| private | m | std:: | {} | |
| private | m | std::vector<i32> | {} | |
| private | m | std::vector<ecs::entity> | {} | |
| private | m | bool | false | |
| private | mQueryCache | core:: | {} | |
| private | mQueryScopes | std:: | {} | |
| private | mRegistry | ecs:: | nullptr | |
| private | mReloadCount | u32 | 0 | |
| private | m | ecs::observer_id | {} | |
| private | mScratch | core:: | — | |
| private | m | ecs::component_id | {} | |
| private | mStatus | script_host_status | script_ | |
| private | mStore | script_store | {} | |
| private | m | std::vector<u64> | {} | |
| private | m | std::vector<u64> | {} | |
| private | mWorld | ecs::world * | nullptr | |
| private | m | u32 | 0 | |
| public | noexcept | [[nodiscard]] const std:: | { return m | The collision source set with set_collision_source(), or an empty function. |
| public | QUERY_ | static constexpr u32 | 16 | Chunk views a query scope holds without touching the heap: 10,000 rows of a 12-byte component are 13 chunks of 819 rows. A larger scope spills its state once per size step; finished states are reused best-fit, so the spilled one keeps serving the large scope. |
| public | QUERY_ | static constexpr u32 | 4 | Scope states (open and reusable) reserved up front: the nesting depth scripts realistically reach. |
Functions¶
Public¶
active¶
active¶[[nodiscard]] static script_runtime *active() noexcept;The single live runtime of the process, or nullptr.
activity_tags¶
activity_tags¶[[nodiscard]] std::span<const ecs::component_id> activity_tags() const noexcept;The ids set_activity_tags kept (the valid ones, in the order given).
add_script¶
add_script¶[[nodiscard]] script_entry_id add_script(
ecs::entity entity,
u64 classHash,
const core::json::value &fields);Adds a script_component when missing, appends an entry with the given JSON fields (an object; invalid = defaults) and, in PLAY mode, queues its creation for the next flush. An invalid id when the entity is dead, the world detached or the entity already carries MAX_SCRIPTS_PER_ENTITY scripts, and (with a WARN) when the entity has no script_component yet while the world is locked for iteration: adding that component is a structural change. An id is_deferred_reserved() answers true for takes the script anyway: the entry is staged in a set of its own and the script_component is recorded in deferred_commands() behind the earlier commands on the id, so the flush places the entity with the set and queues the creation (a destroy or a removal of script_component recorded later drops the staged scripts, as it drops the component). The returned id names the entry in that set; when the entity already holds a script_component at the flush (a deferred instantiation root whose archive carries scripts), the staged entries are appended to its set instead and the id goes stale; entries that would take that set past MAX_SCRIPTS_PER_ENTITY are dropped at the flush with a WARN. On a reserved id the result is invalid only when the staged set already holds MAX_SCRIPTS_PER_ENTITY scripts or the registry has no script_component type.
any_class_has¶
any_class_has¶[[nodiscard]] bool any_class_has(
script_callback callback) const noexcept;True when a class of the loaded game assembly overrides the callback (the union of the callback masks, computed when an assembly load commits its classes); false without an assembly and for COUNT. The engine converts physics STAY contacts only while this answers true for COLLISION_STAY.
assembly_path¶
assembly_path¶[[nodiscard]] const std::filesystem::path &assembly_path() const noexcept;attach_registry¶
attach_registry¶void attach_registry(
ecs::component_registry *registry);The registry [EcsComponent] types register into (non-owning). Needed for component_register_managed and component_lookup_type; defaults to none.
attach_world¶
attach_world¶void attach_world(
ecs::world *world);The world scripts act on (non-owning; nullptr detaches). Registers the script_component and activity tag observers on it and adopts the script sets its entities already carry (queuing their creates in PLAY mode); the owner must destroy_all() before destroying the world. Swapping to another world destroys the live instances of the old one without OnDestroy (WARN when any exist): instances are bound to the ids of the world they were created on. The recorded activity changes are forgotten; instances that outlived a detach from the same world are checked against their entity's tags again in PLAY mode.
begin_query_scope¶
begin_query_scope¶[[nodiscard]] core::result<u32> begin_query_scope(
std::span<const u32> typeIds,
std::span<const u32> withoutIds,
conjure_query_scope &out);Opens a scope over the archetypes holding every type of typeIds (1..8) and none of withoutIds (0..8): locks the world, fills the chunk views (columns in typeIds order, null for an absent id), bumps the change versions of the written columns (only typeIds are columns). WRONG_THREAD, NOT_IN_PHASE, NOT_INITIALISED, INVALID_ARGUMENT (no world, a bad or unregistered id in either list, a without id that is also in typeIds; id 0 is never valid). Allocation-free once warm: the ecs::query behind a pair of component sets is cached for the life of the attached world (cached_query_count()) and finished scope states are reused, so the scripting.update_10k_dod gate of holds.
[[nodiscard]] core::result<u32> begin_query_scope(
std::span<const u32> typeIds,
conjure_query_scope &out);begin_query_scope(typeIds, {}, out): a scope that excludes nothing.
cached_query_count¶
cached_query_count¶[[nodiscard]] u32 cached_query_count() const noexcept;Distinct (with, without) component set pairs begin_query_scope has cached a query for since the world was attached.
classes¶
classes¶[[nodiscard]] const script_class_registry &classes() const noexcept;classes_mutable¶
classes_mutable¶[[nodiscard]] script_class_registry &classes_mutable() noexcept;The registry the native script_register_class/field entries fill (staging while a load runs).
clone_set_for_copy¶
clone_set_for_copy¶ops.copy: a deep copy of the set for a new component instance (owner unknown until ADDED).
collect_entry_fields¶
collect_entry_fields¶[[nodiscard]] core::result<core::json::document> collect_entry_fields(
script_entry_id id);The entry's fields; for a live entry the JSON is refreshed from the instance first (unknown JSON keys preserved). INSTANCE_NOT_FOUND.
current_phase¶
current_phase¶[[nodiscard]] script_phase current_phase() const noexcept;Phase being run, or COUNT outside a script phase (query_begin is refused with NOT_IN_PHASE then; the bindings entries check the thread only).
deferred_commands¶
deferred_commands¶[[nodiscard]] ecs::command_buffer &deferred_commands() noexcept;The buffer bindings record structural requests into while world::is_locked(); flushed at query_end and at the phase-end force-close, when the world is not locked by anything else then. Valid while a world is attached. An id reserved here is passed to note_deferred_reserved / note_deferred_instance so later requests on it are recorded too.
deserialize_entity_scripts¶
deserialize_entity_scripts¶[[nodiscard]] core::result<void> deserialize_entity_scripts(
ecs::entity entity,
const core::json::value &scripts);Replaces the entity's scripts from the serialize_entity_scripts form (live instances destroyed first, new ones queued in PLAY mode). An entry with "created" is recreated with OnReload instead of OnCreate, one with "started" without OnStart; without them (older JSON) both run. A live instance that such a "created" entry of its class brings back goes without OnDisable and OnDestroy, as on a hot reload; every other live instance gets them (OnDisable when active). The activity changes still pending take effect first, on the live instances. INVALID_ARGUMENT for malformed JSON.
destroy_all¶
destroy_all¶void destroy_all(
bool callOnDestroy);Destroys every live instance (when asked, OnDisable for an active one, then OnDestroy) and clears the pending queues and the recorded activity changes; entries keep their JSON with INVALID_SLOT and lose their CREATED, STARTED, FAULTED and INACTIVE flags.
dispatch_collision_events¶
dispatch_collision_events¶void dispatch_collision_events(
std::span<const collision_event> events);Runs as the FIXED_UPDATE phase: the recorded activity changes take effect first (set_activity_tags), then one conjure_collision_record is built per participating live, active entry whose class overrides the callback of the event's kind (COLLISION_STAY included) and they go out in one dispatch_collisions call. The record buffer is kept between calls, so a warm dispatch allocates nothing.
end_query_scope¶
end_query_scope¶void end_query_scope(
u32 scopeId);Closes a scope (unknown ids are ignored with a DEBUG log) and flushes deferred_commands() once no scope stays open.
entity_name¶
entity_name¶[[nodiscard]] std::string_view entity_name(
ecs::entity entity) const noexcept;The remembered name of a live entity, or "".
entity_name_count¶
entity_name_count¶[[nodiscard]] usize entity_name_count() const noexcept;Entities with a remembered name (diagnostics and tests).
entry¶
entry¶[[nodiscard]] const script_entry *entry(
script_entry_id id) const noexcept;The entry behind an id, or nullptr.
entry_of_slot¶
entry_of_slot¶[[nodiscard]] script_entry_id entry_of_slot(
i32 slot) const noexcept;The entry a managed slot belongs to, or an invalid id.
find_entity_by_name¶
find_entity_by_name¶[[nodiscard]] ecs::entity find_entity_by_name(
std::string_view name) const noexcept;The first live entity remembered under name, or NULL_ENTITY.
flush_pending¶
flush_pending¶void flush_pending();Processes the pending destroys (OnDisable for an active instance, then OnDestroy, then entity destruction), the creates (one create_instances call: OnCreate, or OnReload for an entry a hot reload recreates, each with CREATE_FLAG_INACTIVE when its entity is inactive) and the recorded activity changes (set_activity_tags) until all three are empty or MAX_FLUSH_ITERATIONS passed.
frame_block¶
frame_block¶[[nodiscard]] conjure_frame_block &frame_block() noexcept;free_set_from_destruct¶
free_set_from_destruct¶void free_set_from_destruct(
u32 handle);ops.destruct: frees the set; live slots are detached and their OnDestroy (after OnDisable for an active instance) deferred.
host¶
host¶[[nodiscard]] script_host &host() noexcept;[[nodiscard]] const script_host &host() const noexcept;initialise¶
initialise¶[[nodiscard]] core::result<void> initialise(
const script_runtime_config &config);Bindings must have filled native_api() before this call; the core entries are filled here. Initialises the host and loads config.gameAssemblyPath when set. A host start or table validation failure leaves the runtime DISABLED: entries keep their JSON with INVALID_SLOT and every phase is a no-op. A failure to load config.gameAssemblyPath is returned (ASSEMBLY_LOAD_FAILED) but leaves the runtime READY without an assembly (scenes still load); call load_game_assembly again once it is built.
is_assembly_loaded¶
is_assembly_loaded¶[[nodiscard]] bool is_assembly_loaded() const noexcept;is_deferred_instance¶
is_deferred_instance¶[[nodiscard]] bool is_deferred_instance(
ecs::entity entity) const noexcept;True for a root note_deferred_instance remembered that no flush has applied yet. Such a root takes component, script and destroy requests like any reserved id; record_reserved_remove cannot tell what its archive holds, so it always records for it.
is_deferred_reserved¶
is_deferred_reserved¶[[nodiscard]] bool is_deferred_reserved(
ecs::entity entity) const noexcept;True for an id note_deferred_reserved or note_deferred_instance remembered that no flush of deferred_commands() has applied yet (the world's is_alive answers false for it).
is_entity_active¶
is_entity_active¶[[nodiscard]] bool is_entity_active(
ecs::entity entity) const noexcept;True when the entity is alive in the attached world and carries none of the activity tags; false without a world and for a dead entity.
load_game_assembly¶
load_game_assembly¶[[nodiscard]] core::result<void> load_game_assembly(
const std::filesystem::path &assemblyPath);Loads the game assembly: new load context, classes staged then committed, every entry whose class now exists is created in PLAY mode. With an assembly already loaded this is a reload. NOT_INITIALISED, ASSEMBLY_LOAD_FAILED (nothing changes).
mark_faulted¶
mark_faulted¶void mark_faulted(
i32 slot,
script_callback callback);script_mark_faulted: records the FAULTED flag on the entry of a slot with a WARN (an OnCreate or OnReload fault disables every callback of the instance, any other callback is disabled after three consecutive faults). A fault reported inside create_instances, before the slot is mapped, is applied and logged once the slot is.
mode¶
mode¶[[nodiscard]] script_mode mode() const noexcept;native_api¶
native_api¶[[nodiscard]] conjure_native_api &native_api() noexcept;note_deferred_instance¶
note_deferred_instance¶void note_deferred_instance(
ecs::entity root);Remembers the root deferred_commands().instantiate() returned, until the flush. Its archive gives it components the runtime does not see, so record_reserved_remove always records for it. A null id is ignored.
note_deferred_reserved¶
note_deferred_reserved¶void note_deferred_reserved(
ecs::entity entity,
std::span<const ecs::component_id> recorded = {});Remembers an id create_entity() of deferred_commands() reserved, until the flush that makes it alive or releases it. recorded are the components the caller already added to it in the buffer. A null id is ignored; noting an id twice adds the components to the first note.
note_mirror_mismatch¶
note_mirror_mismatch¶[[nodiscard]] bool note_mirror_mismatch(
u64 nameHash);component_lookup_type: true the first time a mirror name mismatches since the last assembly load, shutdown or world attach (the caller logs it then); false after that.
on_component_added¶
on_component_added¶void on_component_added(
ecs::entity entity,
script_component &component);Called by the ADDED observer: adopts the set (owner = entity; for a zero handle the scripts add_script staged on a reserved id, or else an empty set) and queues creates in PLAY mode.
on_component_removed¶
on_component_removed¶void on_component_removed(
ecs::entity entity,
const script_component &component);Called by the REMOVED observer on script_component (and by ops.destruct for sets freed with live instances): detaches the set's slots and defers their OnDestroy (after OnDisable for an active instance) to the next flush.
read_set_json¶
read_set_json¶[[nodiscard]] core::result<u32> read_set_json(
u32 handle,
const core::json::value &in);serializer.readJson: replaces the entries of a set from the {"scripts":[...]} object ("started" and "created" restore their flags, and live instances are destroyed, as in deserialize_entity_scripts); creates the set when handle is INVALID_SET_HANDLE and returns the handle to store.
record_reserved_add¶
record_reserved_add¶bool record_reserved_add(
ecs::entity entity,
ecs::component_id id,
std::span<const std::byte> payload);component_add on a reserved id: records add_raw in deferred_commands() and returns true; false (nothing recorded) for any other id or an unregistered component id. At the flush a second add of a component with a value overwrites the first, as a set would; an add without a payload gives the default value only when no earlier add on the id carried one, and otherwise keeps that value.
record_reserved_remove¶
record_reserved_remove¶bool record_reserved_remove(
ecs::entity entity,
ecs::component_id id);component_remove on a reserved id: records remove_raw in deferred_commands() (cancelling the earlier adds and sets of the component on it) and returns true when the commands recorded so far give it the component, and always for an instantiation root. False, with nothing recorded, when there is nothing to remove, for any other id and for an unregistered component id. Removing script_component also drops the scripts add_script staged on the id.
record_reserved_set¶
record_reserved_set¶bool record_reserved_set(
ecs::entity entity,
ecs::component_id id,
std::span<const std::byte> payload);component_set on a reserved id: records set_raw in deferred_commands() and returns true; false for any other id or an unregistered component id. A set the flush finds no component for (no add of the component on the id is left at the flush: none was recorded, or a later remove took it) is skipped and counted in the flush's DEBUG line. A tag has no value to write: nothing is recorded and the call still returns true.
registry¶
registry¶[[nodiscard]] ecs::component_registry *registry() const noexcept;reload_game_assembly¶
reload_game_assembly¶[[nodiscard]] core::result<void> reload_game_assembly(
const std::filesystem::path &assemblyPath);Hot reload: load new -> collect fields -> destroy -> unload -> swap registries -> recreate. OnCreate runs once per entity lifetime: an entry whose OnCreate returned (the CREATED flag) is recreated with CREATE_FLAG_ALREADY_CREATED and runs OnReload after its fields are restored, an entry whose create was still queued, or whose OnCreate threw, runs OnCreate, and OnStart does not run again (an entry whose OnCreate threw never attempted it: it runs after that OnCreate). The destroys and activity changes still pending take effect first, on the old instances (OnDestroy, OnDisable, OnEnable); a recreated instance then starts in its entity's state (CREATE_FLAG_INACTIVE). A failed load leaves the running game untouched; a leaked load context is a WARN (ASSEMBLY_LEAKED is logged, not returned).
remap_entity_fields¶
remap_entity_fields¶void remap_entity_fields(
ecs::entity entity,
const std::function<ecs::entity(ecs::entity)> &remap);Rewrites every ENTITY field (and LIST of ENTITY) of the entity's scripts through remap using the class schema and re-applies the fields when live.
remap_set_entities¶
remap_set_entities¶void remap_set_entities(
u32 handle,
const ecs::entity_remap &map);serializer.remapEntities: archive-local references become real through map; real references that are targets of map become archive-local (so the same hook serves capture and instantiation).
remove_script¶
remove_script¶void remove_script(
ecs::entity entity,
script_entry_id id);Destroys the entry's instance now (OnDisable when it is active, then OnDestroy, entity alive) and removes the entry. Ignored (DEBUG log) when the id does not belong to the entity's script set or no world is attached.
request_entity_destroy¶
request_entity_destroy¶void request_entity_destroy(
ecs::entity entity);Entity.Destroy() from C#: an entity with live scripts is destroyed at the next flush, after OnDestroy (preceded by OnDisable for an active instance) ran with the entity alive (even when requested inside a query scope); one without is destroyed now, or through deferred_commands() while the world is locked. An id is_deferred_reserved() answers true for (it has no instance yet) records the destroy in deferred_commands(), where it wins over every command on the id: the id never becomes alive. On a root is_deferred_instance() answers true for, the flush cancels the whole copy, so the archive's inner entities never become alive either. Anything else that is not alive is ignored.
run_phase¶
run_phase¶void run_phase(
script_phase phase,
f32 deltaTime);The recorded activity changes take effect first (set_activity_tags; their OnDisable and OnEnable run in the phase), then one managed call for the phase, then the open query scopes are force-closed (WARN), the deferred commands flushed and flush_pending() run while the phase is still current (so OnCreate/OnDestroy of that flush may open query scopes). Outside run_phase and dispatch_collision_events (FIXED_UPDATE) a query scope is refused with NOT_IN_PHASE: the flushes of frame_begin, frame_end and set_mode run no phase.
sample_managed_memory¶
sample_managed_memory¶[[nodiscard]] managed_memory_delta sample_managed_memory();Samples the managed heap through conjure_managed_api::sample_memory (the engine calls it once per frame, at step 15 of, on the main thread) and returns what changed since the previous sample. Every field is 0 without a ready host or when the sample fails, and the next sample then starts over. The first sample after initialise, and a sample whose cumulative counters went down (the managed runtime restarted), report the heap size and 0 for the rest.
script_component_id¶
script_component_id¶[[nodiscard]] ecs::component_id script_component_id() const noexcept;scripts_of¶
scripts_of¶[[nodiscard]] std::vector<script_entry_id> scripts_of(
ecs::entity entity) const;Every entry id of the entity in set order (empty without scripts).
serialize_entity_scripts¶
serialize_entity_scripts¶[[nodiscard]] core::result<core::json::document> serialize_entity_scripts(
ecs::entity entity);{"scripts":[{"class","hash","fields"}]} of the entity's set (live fields refreshed first), each entry with "started": true and "created": true when its STARTED and CREATED flags are set; {"scripts":[]} for an entity without scripts. ENTITY_NOT_ALIVE through the ecs category.
set_activity_tags¶
set_activity_tags¶void set_activity_tags(
std::span<const ecs::component_id> tags);The component ids that make an entity inactive (the engine passes scene.disabled and scene.inactive, so this module needs no scene code): an instance is active while its entity is alive and carries none of them. Invalid ids are ignored; an empty span (the default) makes every instance active. The runtime observes ADDED and REMOVED of each tag on the attached world (again after attach_world) and records the entity only in PLAY mode, with a ready host, when it carries a script_component: nothing is recorded in EDIT mode, and set_mode and attach_world forget what was recorded, because a PLAY session creates every instance from its entity's current tags (CREATE_FLAG_INACTIVE). A recorded change takes effect where a Destroy does, at the first of: a flush_pending (the end of the phase that made it; for a change made outside a phase, also the flushes of frame_begin, frame_end and set_mode, which run no phase, so a query scope OnEnable or OnDisable opens there is refused with NOT_IN_PHASE), the start of the next run_phase, the start of dispatch_collision_events, and before a hot reload or a set replace (deserialize_entity_scripts, read_set_json) recreates instances. There the live instances whose state differs get one conjure_managed_api::set_active call for those that became inactive (OnDisable), then one for those that became active (OnEnable, then OnStart before the next FIXED_UPDATE or UPDATE when it never ran); a change undone before that point calls nothing. An inactive instance joins no phase, gets no collision records and is not marked started. Changing the tags in PLAY mode re-checks every entity with live scripts at the next of those points.
set_collision_source¶
set_collision_source¶void set_collision_source(
std::function<std::span<const collision_event>()> source);The source scripting.collision_dispatch reads (the engine binds physics_world::contact_events).
set_field¶
set_field¶[[nodiscard]] core::result<void> set_field(
script_entry_id id,
u64 fieldHash,
const core::json::value &value);Rewrites one field's JSON; in PLAY mode also applies it to the live instance as a single-field blob. INSTANCE_NOT_FOUND, CLASS_NOT_FOUND, FIELD_NOT_FOUND, INVALID_ARGUMENT (type mismatch).
set_mode¶
set_mode¶void set_mode(
script_mode mode);EDIT -> PLAY creates every instance of the attached world's entities (and flushes), the instances of an inactive entity with CREATE_FLAG_INACTIVE; PLAY -> EDIT destroys them (OnDisable for an active one, then OnDestroy) and clears their CREATED, STARTED, FAULTED and INACTIVE flags, so the next PLAY runs OnCreate and OnStart again (the created and started flags are for hot reload only). Both forget the recorded activity changes.
shutdown¶
shutdown¶void shutdown();destroy_all(true), unload, host shutdown. The runtime may be initialised again.
stats¶
stats¶[[nodiscard]] script_runtime_stats stats() const noexcept;status¶
status¶[[nodiscard]] script_host_status status() const noexcept;store¶
store¶[[nodiscard]] script_store &store() noexcept;[[nodiscard]] const script_store &store() const noexcept;void¶
void¶core::delegate<void()> on_reloaded =;Fires after a successful reload (editor refreshes inspectors).
world¶
world¶[[nodiscard]] ecs::world *world() const noexcept;write_set_json¶
write_set_json¶void write_set_json(
u32 handle,
core::json::writer &out);serializer.writeJson: the {"scripts":[...]} object of a set (live fields refreshed first; the serialize_entity_scripts form, "started" and "created" included).
Private¶
adopt_world_sets¶
adopt_world_sets¶void adopt_world_sets(
bool queueCreates);apply_entry_fields¶
apply_entry_fields¶[[nodiscard]] core::result<void> apply_entry_fields(
script_entry &entryValue,
const core::json::value &fields);apply_entry_fields_with¶
apply_entry_fields_with¶[[nodiscard]] core::result<void> apply_entry_fields_with(
script_entry &entryValue,
const script_class_info &info,
const core::json::value &fields);cached_query¶
cached_query¶[[nodiscard]] ecs::query &cached_query(
const query_cache_key &key,
const ecs::query_desc &desc);drop_deferred_reservations¶
drop_deferred_reservations¶void drop_deferred_reservations();enter_phase¶
enter_phase¶void enter_phase(
script_phase phase) noexcept;find_reservation¶
find_reservation¶[[nodiscard]] deferred_reservation *find_reservation(
ecs::entity entity) noexcept;flush_deferred_commands¶
flush_deferred_commands¶void flush_deferred_commands();force_close_query_scopes¶
force_close_query_scopes¶void force_close_query_scopes();is_ready¶
is_ready¶[[nodiscard]] bool is_ready() const noexcept;leave_phase¶
leave_phase¶void leave_phase() noexcept;log_faulted¶
log_faulted¶void log_faulted(
i32 slot,
script_callback callback,
const script_entry &entryValue) const;mark_started_entries¶
mark_started_entries¶void mark_started_entries();note_activity_change¶
note_activity_change¶void note_activity_change(
const ecs::world &owner,
ecs::entity entity);process_activity_changes¶
process_activity_changes¶void process_activity_changes();process_pending_creates¶
process_pending_creates¶void process_pending_creates();process_pending_destroys¶
process_pending_destroys¶void process_pending_destroys();queue_create¶
queue_create¶void queue_create(
script_entry_id id);recheck_live_entities¶
recheck_live_entities¶void recheck_live_entities();refresh_live_fields¶
refresh_live_fields¶void refresh_live_fields(
script_entry &entryValue);register_activity_observers¶
register_activity_observers¶void register_activity_observers();reload_internal¶
reload_internal¶[[nodiscard]] core::result<void> reload_internal(
const std::filesystem::path &assemblyPath);replace_set_entries¶
replace_set_entries¶[[nodiscard]] core::result<void> replace_set_entries(
u32 handle,
const core::json::value &in);settle_deferred_reservations¶
settle_deferred_reservations¶void settle_deferred_reservations();stage_reserved_script¶
stage_reserved_script¶[[nodiscard]] script_entry_id stage_reserved_script(
ecs::entity entity,
deferred_reservation &reservation,
u64 classHash,
const core::json::value &fields);take_scope_state¶
take_scope_state¶[[nodiscard]] std::unique_ptr<query_scope_state> take_scope_state(
usize chunkCount);unregister_activity_observers¶
unregister_activity_observers¶void unregister_activity_observers();