16 void operator()(
World* world)
const noexcept;
19 using WorldPtr = std::unique_ptr<World, WorldDeleter>;
21 static auto createWorld() -> WorldPtr;
25 static auto createTypedNode(
World& world, std::string_view type, std::string_view name) ->
Box<Node>;
29 static auto activeRenderCamera(
World& world) ->
Camera*;
30 static auto hasActiveCamera(
World& world) -> bool;
32 static void registerDependency(
Node& from,
Node& to);
39 static void setEnableCallback(
Node& node,
void (*callback)(
void*));
42 static void setTickCallback(
Node& node,
void (*callback)(
void*));
51 static void markEnabled(
Node& node);
63 static void applyLuaOverrides(
75 static auto dependencyGraph(
World& world)
noexcept -> World::DependencyGraph&;
77 static void computeDependencyGraph(
World& world);
82 static auto childrenOf(
const Node& node) ->
const std::vector<Box<Node>>&;
83 static auto changeField(
Node& node, std::string_view name,
const std::any& value) -> bool;
84 static auto setScriptVar(
Node& node, std::string_view path,
const std::any& value) -> bool;
85 static void attachChild(
Node& parent,
Node& child);
86 static auto isPrefabInterior(
const Node& node) -> bool;
88 static void initThreadPool();
90 static void setWorldRoot(
World& world,
Node& node);
102 static void initAssetManager(std::string_view assets_dir, std::string_view cache_dir);
104 static void waitForLoads(
World& world);
106 static void drainLoadQueue(
World& world);
108 static auto dependencyGraphGraphviz(
const World& world) -> std::string;
111 static auto findCached(std::string_view name) ->
Box<Node>;
113 static auto findNode(std::string_view path) ->
Box<Node>;
114 static auto uidPath(
const Node& node) -> std::string;
Type-safe smart pointer for assets.
Definition core_types.hpp:149
Intrusive reference-counted handle to a Node.
Definition box.hpp:35
Definition tick_scheduler.hpp:74
Converts exported Lua script variable values to/from the engine's text encoding.
std::function< toast::Box< toast::Node >(std::string_view)> NodeResolver
Resolves a node UID to a node reference.
Definition lua_value_codec.hpp:24
Member-robber pattern used by the generated reflection code.
Definition defer.hpp:16
NodeState
Definition node.hpp:53
@ root
The node is currently in use within world::root_node.
Definition node.hpp:55
TickFunctionList
Bit-flag set describing which lifecycle phases a Node type implements.
Definition reflect_node.hpp:36
Lua source asset attached to nodes through Node::m_scripts.
One node entry in a prefab file.
Definition prefab.hpp:232
Definition node_owner.hpp:97
Definition tick_scheduler.hpp:51
Definition world_test_access.hpp:15
Definition world_test_access.hpp:14
static auto scheduler(World &world) noexcept -> TickScheduler &
Test-only: the world's scheduler, so tests can run tick phases without the physics step.
Definition world.cpp:1298
static void runTickFrame(World &world)
Test-only: one frame of the scheduled phases (early tick, tick, post physics, late tick).
Definition world.cpp:1302
static void attachScriptInGroup(Node &node, const assets::Handle< assets::Script > &script, uint64_t group)
Like attachScript(), with the runtime placed together with the other nodes of the script group.
Definition world.cpp:1283
static auto moveToChild(World &world, Node &node, Node &parent) -> Box< Node >
Test-only: World::moveToChild(), which the engine reaches through events.
Definition world.cpp:1362