2#include <engine/engine_export.h>
12#include <hpp/span.hpp>
14#include <dotnetpp/dotnetpp.h>
24 static auto get_lib_name(
const std::string& protocol) -> std::string;
31 const hpp::source_location& loc = hpp::source_location::current());
39 void set_debug_config(
const std::string& address, uint32_t port, uint32_t loglevel);
89 auto get_type(
const std::string& name_space,
const std::string&
name)
const -> dotnet::type;
140 void on_frame_update(
rtti::context& ctx,
delta_t dt);
141 void on_frame_fixed_update(
rtti::context& ctx,
delta_t dt);
142 void on_frame_late_update(
rtti::context& ctx,
delta_t dt);
148 void on_play_end(
rtti::context& ctx);
154 void on_pause(
rtti::context& ctx);
160 void on_resume(
rtti::context& ctx);
166 void on_skip_next_frame(
rtti::context& ctx);
168 auto bind_internal_calls(
rtti::context& ctx) ->
bool;
170 void check_for_recompile(
rtti::context& ctx,
delta_t dt,
bool emit_callback);
172 auto create_compilation_job(
rtti::context& ctx, const
std::
string& protocol,
bool debug) -> tpp::job_future<
bool>;
175 std::shared_ptr<
int> sentinel_ =
std::make_shared<
int>(0);
177 delta_t time_since_last_check_{};
179 dotnet::debugging_config debug_config_;
180 std::unique_ptr<dotnet::domain> domain_;
182 engine_script_cache cache_;
184 std::unique_ptr<dotnet::domain> app_domain_;
186 struct app_script_cache
188 std::vector<dotnet::type> scriptable_component_types;
192 enum class call_progress
199 call_progress create_call_{call_progress::not_called};
201 std::vector<tpp::future<void>> compilation_jobs_;
203 bool has_compilation_errors_{};
std::chrono::duration< float > delta_t
@ finished
The action has finished.
Hash specialization for batch_key to enable use in std::unordered_map.
dotnet::type ui_event_manager_type
dotnet::method set_entity_method
dotnet::type update_manager_type
dotnet::type script_system_type
dotnet::method on_sensor_enter_method
dotnet::method update_method
dotnet::method on_start_method
dotnet::method on_collision_enter_method
dotnet::method on_enable_method
dotnet::method on_collision_exit_method
dotnet::method on_disable_method
dotnet::method ui_dispatch_event_method
dotnet::method fixed_update_method
dotnet::method late_update_method
dotnet::method on_create_method
dotnet::type component_type
dotnet::method on_destroy_method
dotnet::type script_component_type
dotnet::method on_sensor_exit_method
static auto is_debugger_attached() -> bool
static auto get_lib_name(const std::string &protocol) -> std::string
auto get_scriptable_component_base_type() const -> dotnet::type
static void on_load_component(entt::registry &r, entt::entity e)
Called when a script component is loaded.
auto is_create_called() const -> bool
auto get_type(const std::string &name_space, const std::string &name) const -> dotnet::type
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 find_dotnet_paths(const rtti::context &ctx) -> dotnet::compiler_paths
script_system(rtti::context &ctx, cmd_line::parser &parser)
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 has_compilation_errors() const -> bool
void on_collision_enter(entt::handle a, entt::handle b, const std::vector< manifold_point > &manifolds)
auto get_app_assembly() const -> dotnet::assembly
auto get_cache() const -> const engine_script_cache &
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
auto get_all_scriptable_components() const -> const std::vector< dotnet::type > &
static void on_create_active_component(entt::registry &r, entt::entity e)
auto get_type_by_fullname(const std::string &fullname) const -> dotnet::type
static void log_exception(const dotnet::exception &e, const hpp::source_location &loc=hpp::source_location::current())
void on_play_begin(rtti::context &ctx)
Called when playback begins.
auto deinit(rtti::context &ctx) -> bool
auto get_engine_assembly() const -> dotnet::assembly
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)
void on_sensor_enter(entt::handle sensor, entt::handle other, const std::vector< manifold_point > &manifolds)
void on_sensor_exit(entt::handle sensor, entt::handle other, const std::vector< manifold_point > &manifolds)
static void on_destroy_component(entt::registry &r, entt::entity e)
Called when a physics component is destroyed.
auto init(rtti::context &ctx, const cmd_line::parser &parser) -> bool