Unravel Engine C++ Reference
Loading...
Searching...
No Matches
entity.cpp File Reference
#include "entity.hpp"
#include <chrono>
#include <serialization/archives/yaml.hpp>
#include <serialization/associative_archive.h>
#include <serialization/binary_archive.h>
#include <serialization/serialization.h>
#include "components/all_components.h"
#include <engine/engine.h>
#include <engine/events.h>
#include <engine/rendering/ecs/systems/rendering_system.h>
#include <engine/scripting/ecs/systems/script_system.h>
#include <engine/meta/core/common/basetypes.hpp>
#include "entt/entity/fwd.hpp"
#include "logging/logging.h"
#include "reflection/reflection.h"
#include "uuid/uuid.h"
#include <hpp/utility.hpp>
#include <sstream>

Go to the source code of this file.

Classes

struct  unravel::entity_components< Entity >
 
struct  unravel::entity_data< Entity >
 

Namespaces

namespace  unravel
 
namespace  ser20
 

Enumerations

enum  unravel::entity_flags { unravel::none , unravel::resolve_with_existing , unravel::resolve_with_loaded }
 

Functions

auto unravel::const_handle_cast (entt::const_handle chandle) -> entt::handle
 
auto unravel::as_span (const std::vector< entity_data< entt::handle > > &entities) -> hpp::span< const entt::handle >
 
auto unravel::push_load_context (entt::registry &registry) -> bool
 
void unravel::pop_load_context (bool push_result)
 
auto unravel::get_load_context () -> load_context &
 
auto unravel::push_save_context () -> bool
 
void unravel::pop_save_context (bool push_result)
 
auto unravel::get_save_context () -> save_context &
 
void unravel::add_to_uid_mapping (entt::handle &obj, bool recursive=true)
 
void unravel::cleanup_uid_mapping ()
 
auto unravel::is_parent (entt::const_handle potential_parent, entt::const_handle child) -> bool
 
auto unravel::find_root (entt::const_handle e) -> entt::const_handle
 
auto unravel::are_related (entt::const_handle lhs, entt::const_handle rhs) -> bool
 
auto unravel::push_entity_path (entt::const_handle obj) -> bool
 
void unravel::pop_entity_path (bool pushed)
 
template<typename Archive >
void ser20::save_entity_id (Archive &ar, const entt::const_handle &obj)
 
template<typename Archive >
void ser20::save_entity_uid (Archive &ar, const entt::const_handle &obj)
 
template<typename Archive >
void ser20::save_entity (Archive &ar, const entt::const_handle &obj, entity_flags flags)
 
template<typename Archive >
auto ser20::load_entity_from_id (Archive &ar, entt::handle &obj, entity_flags flags) -> bool
 
template<typename Archive >
auto ser20::load_entity_from_uid (Archive &ar, entt::handle &obj, entity_flags flags) -> bool
 
template<typename Archive >
void ser20::load_entity (Archive &ar, entt::handle &obj, entity_flags flags)
 
template<typename Component >
auto ser20::should_save_component (const entt::const_handle &obj) -> bool
 
template<typename Component >
auto ser20::should_load_component (const entt::handle &obj) -> bool
 
 ser20::SAVE (entt::const_handle)
 
 ser20::SAVE_INSTANTIATE (entt::const_handle, ser20::oarchive_associative_t)
 
 ser20::SAVE_INSTANTIATE (entt::const_handle, ser20::oarchive_binary_t)
 
 ser20::LOAD (entt::handle)
 
 ser20::LOAD_INSTANTIATE (entt::handle, ser20::iarchive_associative_t)
 
 ser20::LOAD_INSTANTIATE (entt::handle, ser20::iarchive_binary_t)
 
 ser20::SAVE (const_entity_handle_link)
 
 ser20::SAVE_INSTANTIATE (const_entity_handle_link, ser20::oarchive_associative_t)
 
 ser20::SAVE_INSTANTIATE (const_entity_handle_link, ser20::oarchive_binary_t)
 
 ser20::LOAD (entity_handle_link)
 
 ser20::LOAD_INSTANTIATE (entity_handle_link, ser20::iarchive_associative_t)
 
 ser20::LOAD_INSTANTIATE (entity_handle_link, ser20::iarchive_binary_t)
 
 ser20::SAVE (entity_components< entt::const_handle >)
 
 ser20::SAVE_INSTANTIATE (entity_components< entt::const_handle >, ser20::oarchive_associative_t)
 
 ser20::SAVE_INSTANTIATE (entity_components< entt::const_handle >, ser20::oarchive_binary_t)
 
 ser20::LOAD (entity_components< entt::handle >)
 
 ser20::LOAD_INSTANTIATE (entity_components< entt::handle >, ser20::iarchive_associative_t)
 
 ser20::LOAD_INSTANTIATE (entity_components< entt::handle >, ser20::iarchive_binary_t)
 
 ser20::SAVE (entity_data< entt::const_handle >)
 
 ser20::SAVE_INSTANTIATE (entity_data< entt::const_handle >, ser20::oarchive_associative_t)
 
 ser20::SAVE_INSTANTIATE (entity_data< entt::const_handle >, ser20::oarchive_binary_t)
 
 ser20::LOAD (entity_data< entt::handle >)
 
 ser20::LOAD_INSTANTIATE (entity_data< entt::handle >, ser20::iarchive_associative_t)
 
 ser20::LOAD_INSTANTIATE (entity_data< entt::handle >, ser20::iarchive_binary_t)
 
void unravel::save_to_stream (std::ostream &stream, entt::const_handle obj)
 
void unravel::save_to_file (const std::string &absolute_path, entt::const_handle obj)
 
void unravel::save_to_stream_bin (std::ostream &stream, entt::const_handle obj)
 
void unravel::save_to_file_bin (const std::string &absolute_path, entt::const_handle obj)
 
void unravel::load_from_view (std::string_view view, entt::handle &obj)
 
void unravel::load_from_stream (std::istream &stream, entt::handle &obj)
 
void unravel::load_from_file (const std::string &absolute_path, entt::handle &obj)
 
void unravel::load_from_stream_bin (std::istream &stream, entt::handle &obj)
 
void unravel::load_from_file_bin (const std::string &absolute_path, entt::handle &obj)
 
auto unravel::load_from_prefab_out (const asset_handle< prefab > &pfb, entt::registry &registry, entt::handle &obj) -> bool
 
auto unravel::load_from_prefab (const asset_handle< prefab > &pfb, entt::registry &registry) -> entt::handle
 
auto unravel::load_from_prefab_bin (const asset_handle< prefab > &pfb, entt::registry &registry) -> entt::handle
 
void unravel::clone_entity_from_stream (entt::const_handle src_obj, entt::handle &dst_obj)
 
void unravel::save_to_stream (std::ostream &stream, const scene &scn)
 
void unravel::save_to_file (const std::string &absolute_path, const scene &scn)
 
void unravel::save_to_stream_bin (std::ostream &stream, const scene &scn)
 
void unravel::save_to_file_bin (const std::string &absolute_path, const scene &scn)
 
void unravel::load_from_view (std::string_view view, scene &scn)
 
void unravel::load_from_stream (std::istream &stream, scene &scn)
 
void unravel::load_from_file (const std::string &absolute_path, scene &scn)
 
void unravel::load_from_stream_bin (std::istream &stream, scene &scn)
 
void unravel::load_from_file_bin (const std::string &absolute_path, scene &scn)
 
auto unravel::load_from_prefab (const asset_handle< scene_prefab > &pfb, scene &scn) -> bool
 
auto unravel::load_from_prefab_bin (const asset_handle< scene_prefab > &pfb, scene &scn) -> bool
 
void unravel::clone_scene_from_stream (const scene &src_scene, scene &dst_scene)
 

Variables

thread_local load_contextunravel::load_ctx_ptr {}
 
thread_local save_contextunravel::save_ctx_ptr {}
 
std::atomic_bool unravel::writing = false
 
std::atomic_bool unravel::reading = false