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

@ -35,13 +35,6 @@ IKA_API IkarusBlueprint * ikarus_blueprint_create(struct IkarusProject * project
/// \remark The blueprint must not be accessed after deletion.
IKA_API void ikarus_blueprint_delete(IkarusBlueprint * blueprint);
/// \brief Gets the number of properties of a blueprint.
/// \param blueprint The blueprint to get the number of properties of.
/// \pre \li Must not be null.
/// \pre \li Must exist.
/// \return The number of properties or undefined if an error occurs.
IKA_API size_t ikarus_blueprint_get_property_count(IkarusBlueprint const * blueprint);
/// \brief Gets the properties of a blueprint.
/// \param blueprint The blueprint to get the properties of.
/// \pre \li Must not be null.
@ -49,16 +42,17 @@ IKA_API size_t ikarus_blueprint_get_property_count(IkarusBlueprint const * bluep
/// \param properties_out The buffer to write the properties to.
/// \pre \li Must not be null.
/// \param properties_out_size The size of the buffer.
/// \see ikarus_blueprint_get_property_count
IKA_API void ikarus_blueprint_get_properties(
IkarusBlueprint const * blueprint, struct IkarusProperty ** properties_out, size_t properties_out_size
);
/// \brief Gets the number of entities linked to a blueprint.
/// \param blueprint The blueprint to get the number of linked entities of.
/// \brief Gets the number of properties of a blueprint.
/// \param blueprint The blueprint to get the number of properties of.
/// \pre \li Must not be null.
/// \pre \li Must exist.
/// \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);
/// \return The number of properties or undefined if an error occurs.
IKA_API size_t ikarus_blueprint_get_property_count(IkarusBlueprint const * blueprint);
/// \brief Gets the entities linked to a blueprint.
/// \param blueprint The blueprint to get the linked entities of.
@ -67,10 +61,18 @@ IKA_API size_t ikarus_blueprint_get_linked_entity_count(IkarusBlueprint const *
/// \param entities_out The buffer to write the entities to.
/// \pre \li Must not be null.
/// \param entities_out_size The size of the buffer.
/// \see ikarus_blueprint_get_linked_entity_count
IKA_API void ikarus_blueprint_get_linked_entities(
IkarusBlueprint const * blueprint, struct IkarusEntity ** entities_out, size_t entities_out_size
);
/// \brief Gets the number of entities linked to a blueprint.
/// \param blueprint The blueprint to get the number of linked entities of.
/// \pre \li Must not be null.
/// \pre \li Must exist.
/// \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);
/// \brief Casts a blueprint to an object.
/// \param blueprint The blueprint to cast.
/// \pre \li Must not be null.

View file

@ -45,13 +45,9 @@ struct IkarusEntity;
/// \param name The name of the entity.
/// \pre \li Must not be null.
/// \pre \li Must not be empty.
/// \param blueprints Blueprints to link the entity to (0..n). Null is treated as an empty array.
/// \param blueprints_count The number of blueprints.
/// \return The created entity or null if an error occurs.
/// \remark Must be freed using #ikarus_free.
IKA_API IkarusEntity * ikarus_entity_create(
struct IkarusProject * project, char const * name, struct IkarusBlueprint ** blueprints, size_t blueprints_count
);
IKA_API IkarusEntity * ikarus_entity_create(struct IkarusProject * project, char const * name);
/// \brief Deletes an entity.
/// \param entity The entity to delete.

View file

@ -22,6 +22,12 @@ enum IkarusObjectType {
IkarusObjectType_Property = 0b00000011,
};
/// \brief Converts an IkarusObjectType to a string.
/// \param type The type to convert.
/// \return The string representation of the type.
/// \remark The returned string must not be freed.
char const * ikarus_object_type_to_string(IkarusObjectType type);
IKARUS_END_HEADER
/// @}