add flatbuffers support and initial rewrite

Signed-off-by: Folling <mail@folling.io>
This commit is contained in:
Folling 2024-05-12 14:15:42 +02:00 committed by Folling
parent b5852698e3
commit 70820129ae
Signed by: folling
SSH key fingerprint: SHA256:S9qEx5WCFFLK49tE/LKnKuJYM5sw+++Dn6qJbbyxnCY
72 changed files with 3929 additions and 1403 deletions

View file

@ -4,7 +4,6 @@
/// \author Folling <folling@ikarus.world>
#include <ikarus/errors.h>
#include <ikarus/id.h>
#include <ikarus/macros.h>
#include <ikarus/stdtypes.h>
@ -14,9 +13,10 @@
IKARUS_BEGIN_HEADER
/// \brief A blueprint object.
/// \details A blueprint is a collection of properties which can be linked to entities.
/// Each entity the blueprint is linked to will have values for the blueprints properties.q
/// \brief Blueprints are templates for managing common properties of entities.
/// \details A blueprint is a collection of properties which can be linked to entities.
/// Each entity the blueprint is linked to will have values for the blueprints
/// properties. Changes in blueprints will be reflected in all linked entities.
struct IkarusBlueprint;
/// \brief Creates a blueprint.
@ -25,19 +25,24 @@ struct IkarusBlueprint;
/// \pre \li Must exist.
/// \param name The name of the blueprint.
/// \pre \li Must not be null.
/// \pre \li Must not be empty.
/// \pre \li Must be unique among all blueprints in the project.
/// \param error_out \see errors.h
/// \return The created blueprint or null if an error occurs.
IKA_API IkarusBlueprint * ikarus_blueprint_create(struct IkarusProject * project, char const * name, IkarusErrorData * error_out);
IKA_API IkarusBlueprint * ikarus_blueprint_create(
struct IkarusProject * project,
char const * name,
IkarusErrorData * error_out
);
/// \brief Deletes & frees a blueprint.
/// \brief Deletes a blueprint.
/// \param blueprint The blueprint to delete.
/// \pre \li Must not be null.
/// \pre \li Must exist.
/// \param error_out \see errors.h
/// \remark The blueprint must not be accessed after deletion.
IKA_API void ikarus_blueprint_delete(IkarusBlueprint * blueprint, IkarusErrorData * error_out);
IKA_API void ikarus_blueprint_delete(
IkarusBlueprint * blueprint,
IkarusErrorData * error_out
);
/// \brief Gets the ID of a blueprint.
/// \param blueprint The blueprint to get the ID of.
@ -45,23 +50,32 @@ IKA_API void ikarus_blueprint_delete(IkarusBlueprint * blueprint, IkarusErrorDat
/// \pre \li Must exist.
/// \param error_out \see errors.h
/// \return The ID of the blueprint or 0 if an error occurs.
IKA_API IkarusId ikarus_blueprint_get_id(IkarusBlueprint const * blueprint, IkarusErrorData * error_out);
IKA_API int64_t ikarus_blueprint_get_id(
IkarusBlueprint const * blueprint,
IkarusErrorData * error_out
);
/// \brief Gets the project a blueprint is part of.
/// \param blueprint The blueprint to get the project of.
/// \pre \li Must not be null.
/// \pre \li Must exist.
/// \param error_out \see errors.h
/// \return The project the blueprint is part of or null if an error occurs.
IKA_API IkarusProject * ikarus_blueprint_get_project(IkarusBlueprint const * blueprint, IkarusErrorData * error_out);
/// \return The project or null if an error occurs.
IKA_API IkarusProject * ikarus_blueprint_get_project(
IkarusBlueprint const * blueprint,
IkarusErrorData * error_out
);
/// \brief Gets the name of a blueprint.
/// \param blueprint The blueprint to get the name of.
/// \pre \li Must not be null.
/// \pre \li Must exist.
/// \param error_out \see errors.h
/// \return The name of the blueprint or null if an error occurs.
IKA_API char const * ikarus_blueprint_get_name(IkarusBlueprint const * blueprint, IkarusErrorData * error_out);
/// \return The name or null if an error occurs.
IKA_API char const * ikarus_blueprint_get_name(
IkarusBlueprint const * blueprint,
IkarusErrorData * error_out
);
/// \brief Sets the name of a blueprint.
/// \param blueprint The blueprint to set the name of.
@ -69,10 +83,12 @@ IKA_API char const * ikarus_blueprint_get_name(IkarusBlueprint const * blueprint
/// \pre \li Must exist.
/// \param name The new name of the blueprint.
/// \pre \li Must not be null.
/// \pre \li Must not be empty.
/// \pre \li Must be unique among all blueprints in the project.
/// \param error_out \see errors.h
IKA_API void ikarus_blueprint_set_name(IkarusBlueprint * blueprint, char const * name, IkarusErrorData * error_out);
IKA_API void ikarus_blueprint_set_name(
IkarusBlueprint * blueprint,
char const * name,
IkarusErrorData * error_out
);
/// \brief Gets the properties of a blueprint.
/// \param blueprint The blueprint to get the properties of.
@ -96,7 +112,10 @@ IKA_API void ikarus_blueprint_get_properties(
/// \pre \li Must exist.
/// \param error_out \see errors.h
/// \return The number of properties or undefined if an error occurs.
IKA_API size_t ikarus_blueprint_get_property_count(IkarusBlueprint const * blueprint, IkarusErrorData * error_out);
IKA_API size_t ikarus_blueprint_get_property_count(
IkarusBlueprint const * blueprint,
IkarusErrorData * error_out
);
/// \brief Gets the entities linked to a blueprint.
/// \param blueprint The blueprint to get the linked entities of.
@ -120,7 +139,10 @@ IKA_API void ikarus_blueprint_get_linked_entities(
/// \pre \li Must exist.
/// \param error_out \see errors.h
/// \return The number of linked entities or undefined if an error occurs.
IKA_API size_t ikarus_blueprint_get_linked_entity_count(IkarusBlueprint const * blueprint, IkarusErrorData * error_out);
IKA_API size_t ikarus_blueprint_get_linked_entity_count(
IkarusBlueprint const * blueprint,
IkarusErrorData * error_out
);
IKARUS_END_HEADER