finalize entity functions

Signed-off-by: Folling <mail@folling.io>
This commit is contained in:
Folling 2025-01-02 09:39:08 +01:00
parent bdee0b4c8e
commit 921d251c96
Signed by: folling
SSH key fingerprint: SHA256:S9qEx5WCFFLK49tE/LKnKuJYM5sw+++Dn6qJbbyxnCY
18 changed files with 523 additions and 181 deletions

View file

@ -181,8 +181,6 @@ IKA_API void ikarus_entity_link_blueprint(
enum IkarusEntityUnlinkBlueprintFlags {
/// \brief No flags.
IkarusEntityUnlinkBlueprintFlags_None = 0,
/// \brief Keep the values associated with the blueprint, transforming them into entity values.
IkarusEntityUnlinkBlueprintFlags_KeepValues = 1,
};
/// \brief Unlinks an entity from a blueprint.
@ -203,17 +201,27 @@ IKA_API void ikarus_entity_unlink_blueprint(
IkarusErrorData * error_out
);
/// \brief Struct for an entity value.
struct IkarusEntityValue {
/// \brief The name of the value.
char const * name;
/// \brief The value in json format. \see value.h
char const * value;
};
/// \brief Gets the values of an entity.
/// \param entity The entity to get the values of.
/// \pre \li Must not be null.
/// \pre \li Must exist.
/// \param size_out An out parameter for the number of values in the returned array
/// or undefined if an error occurs.
/// \param error_out \see errors.h
/// \return The values, in json format of or null if an error occurs.
/// The json representation is an array of objects with the following keys:
/// - `name`: The name of the value.
/// - `value`: The value itself. \see value.h
IKA_API char const *
ikarus_entity_get_values(IkarusEntity * entity, IkarusErrorData * error_out);
/// \return The values or null if an error occurs.
IKA_API IkarusEntityValue * ikarus_entity_get_values(
IkarusEntity * entity,
size_t * size_out,
IkarusErrorData * error_out
);
/// \brief Gets a value of an entity.
/// \param entity The entity to get the value of.
@ -279,16 +287,25 @@ IKA_API void ikarus_entity_delete_value(
IkarusErrorData * error_out
);
/// \brief Struct for an entity property value.
struct IkarusEntityPropertyValue {
/// \brief The property.
struct IkarusProperty * property;
/// \brief The value in json format. \see value.h
char const * value;
};
/// \brief Gets the property values of an entity.
/// \param entity The entity to get the property values of.
/// \pre \li Must not be null.
/// \pre \li Must exist.
/// \param size_out An out parameter for the number of property values in the
/// returned array or undefined if an error occurs.
/// \param error_out \see errors.h
/// \return The property values, in msgpack format of or null if an error occurs.
/// The format is a map of property pointers (as integers) to values. \see
/// value.h
IKA_API char const * ikarus_entity_get_property_values(
/// \return The property values, or null if an error occurs.
IKA_API IkarusEntityPropertyValue * ikarus_entity_get_property_values(
IkarusEntity * entity,
size_t * size_out,
IkarusErrorData * error_out
);