make object fields public and fixup compile errors

Signed-off-by: Folling <mail@folling.io>
This commit is contained in:
Folling 2023-12-26 13:09:41 +01:00 committed by Folling
parent 8a76573983
commit 5da995b47e
No known key found for this signature in database
13 changed files with 258 additions and 216 deletions

View file

@ -2,7 +2,10 @@
#include "ikarus/persistence/project.h"
#include <objects/blueprint.hpp>
#include <objects/entity.hpp>
#include <objects/properties/number_property.hpp>
#include <objects/properties/property.hpp>
#include <objects/properties/text_property.hpp>
#include <objects/properties/toggle_property.hpp>
#include <persistence/function_context.hpp>
@ -31,7 +34,7 @@ IkarusBlueprint * IkarusProject::get_blueprint(IkarusId id) {
return get_cached_object<IkarusBlueprint>(id, this->_blueprints);
}
auto IkarusProject::uncache_blueprint(IkarusBlueprint * blueprint) -> void {
auto IkarusProject::uncache(IkarusBlueprint * blueprint) -> void {
remove_cached_object(blueprint, _blueprints);
}
@ -39,7 +42,7 @@ auto IkarusProject::get_entity(IkarusId id) -> IkarusEntity * {
return get_cached_object<IkarusEntity>(id, this->_entities);
}
auto IkarusProject::uncache_entity(IkarusEntity * entity) -> void {
auto IkarusProject::uncache(IkarusEntity * entity) -> void {
remove_cached_object(entity, _entities);
}
@ -60,6 +63,6 @@ auto IkarusProject::get_property(IkarusId id, IkarusPropertyType type) -> Ikarus
return iter->second.get();
}
auto IkarusProject::uncache_property(IkarusProperty * property) -> void {
auto IkarusProject::uncache(IkarusProperty * property) -> void {
remove_cached_object(property, _properties);
}

View file

@ -11,10 +11,6 @@
#include <ikarus/id.h>
#include <ikarus/objects/properties/property_type.h>
#include <objects/blueprint.hpp>
#include <objects/entity.hpp>
#include <objects/properties/property.hpp>
constexpr inline auto MAXIMUM_ERROR_INFOS = 8;
/// \private
@ -32,13 +28,13 @@ public:
public:
[[nodiscard]] auto get_blueprint(IkarusId id) -> struct IkarusBlueprint *;
auto uncache_blueprint(struct IkarusBlueprint * blueprint) -> void;
auto uncache(struct IkarusBlueprint * blueprint) -> void;
[[nodiscard]] auto get_entity(IkarusId id) -> struct IkarusEntity *;
auto uncache_entity(struct IkarusEntity * entity) -> void;
auto uncache(struct IkarusEntity * entity) -> void;
[[nodiscard]] auto get_property(IkarusId id, IkarusPropertyType type) -> struct IkarusProperty *;
auto uncache_property(struct IkarusProperty * property) -> void;
auto uncache(struct IkarusProperty * property) -> void;
private:
template<typename T>
@ -54,7 +50,7 @@ private:
template<typename T>
void remove_cached_object(T * object, std::unordered_map<IkarusId, std::unique_ptr<T>>& cache) {
cache.erase(object->get_id());
cache.erase(object->id);
}
private: