2#include <engine/engine_export.h>
11#include <hpp/span.hpp>
13#include <monopp/mono_exception.h>
14#include <monopp/mono_jit.h>
15#include <monort/monort.h>
25 static auto get_lib_name(
const std::string& protocol) -> std::string;
32 const hpp::source_location& loc = hpp::source_location::current());
38 void set_debug_config(
const std::string& address, uint32_t port, uint32_t loglevel);
58 void on_collision_enter(entt::handle
a, entt::handle
b,
const std::vector<manifold_point>& manifolds);
59 void on_collision_exit(entt::handle
a, entt::handle
b,
const std::vector<manifold_point>& manifolds);
124 auto create_compilation_job(
rtti::context& ctx,
const std::string& protocol,
bool debug) -> tpp::job_future<bool>;
127 std::shared_ptr<int> sentinel_ = std::make_shared<int>(0);
129 delta_t time_since_last_check_{};
131 mono::debugging_config debug_config_;
132 std::unique_ptr<mono::mono_domain> domain_;
136 mono::mono_type update_manager_type;
137 mono::mono_type script_system_type;
138 mono::mono_type native_component_type;
139 mono::mono_type script_component_type;
142 std::unique_ptr<mono::mono_domain> app_domain_;
144 struct mono_app_cache
146 std::vector<mono::mono_type> scriptable_component_types;
150 enum class call_progress
157 call_progress create_call_{call_progress::not_called};
159 std::vector<tpp::future<void>> compilation_jobs_;
161 bool has_compilation_errors_{};
std::chrono::duration< float > delta_t
static auto is_debugger_attached() -> bool
static auto get_lib_name(const std::string &protocol) -> std::string
auto is_create_called() const -> bool
static auto get_lib_data_key(const std::string &protocol) -> std::string
static auto get_script_debug_mode() -> bool
void unload_engine_domain()
auto is_update_called() const -> bool
static auto get_lib_compiled_key(const std::string &protocol) -> std::string
static auto get_lib_temp_compiled_key(const std::string &protocol) -> std::string
static void set_script_debug_mode(bool debug)
auto load_engine_domain(rtti::context &ctx, bool recompile) -> bool
auto get_app_assembly() const -> mono::mono_assembly
auto has_compilation_errors() const -> bool
void on_collision_enter(entt::handle a, entt::handle b, const std::vector< manifold_point > &manifolds)
auto init(rtti::context &ctx) -> bool
static void on_create_component(entt::registry &r, entt::entity e)
Called when a physics component is created.
static void set_needs_recompile(const std::string &protocol, bool now=false)
void set_debug_config(const std::string &address, uint32_t port, uint32_t loglevel)
static void copy_compiled_lib(const fs::path &from, const fs::path &to)
static void on_destroy_active_component(entt::registry &r, entt::entity e)
auto load_app_domain(rtti::context &ctx, bool recompile) -> bool
static auto find_mono(const rtti::context &ctx) -> mono::compiler_paths
void on_sensor_exit(entt::handle sensor, entt::handle other)
void on_sensor_enter(entt::handle sensor, entt::handle other)
static void log_exception(const mono::mono_exception &e, const hpp::source_location &loc=hpp::source_location::current())
auto get_engine_assembly() const -> mono::mono_assembly
static void on_create_active_component(entt::registry &r, entt::entity e)
void on_play_begin(rtti::context &ctx)
Called when playback begins.
auto deinit(rtti::context &ctx) -> bool
auto get_all_scriptable_components() const -> const std::vector< mono::mono_type > &
void on_collision_exit(entt::handle a, entt::handle b, const std::vector< manifold_point > &manifolds)
void wait_for_jobs_to_finish(rtti::context &ctx)
static void on_destroy_component(entt::registry &r, entt::entity e)
Called when a physics component is destroyed.