add src/ikarus subdir and make names unique for objects per scope

Signed-off-by: Folling <mail@folling.io>
This commit is contained in:
Folling 2024-01-30 09:31:08 +01:00 committed by Folling
parent c65211e4ff
commit 5dce2ced94
No known key found for this signature in database
51 changed files with 590 additions and 735 deletions

View file

@ -25,9 +25,9 @@ struct IkarusBlueprint;
/// \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.
/// \remark Must be freed using #ikarus_free.
IKA_API IkarusBlueprint * ikarus_blueprint_create(struct IkarusProject * project, char const * name, IkarusErrorData * error_out);
/// \brief Deletes & frees a blueprint.
@ -38,6 +38,33 @@ 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, 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);
/// \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);
/// \brief Sets the name of a blueprint.
/// \param blueprint The blueprint to set the name of.
/// \pre \li Must not be null.
/// \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);
/// \brief Gets the properties of a blueprint.
/// \param blueprint The blueprint to get the properties of.
/// \pre \li Must not be null.
@ -86,18 +113,6 @@ IKA_API void ikarus_blueprint_get_linked_entities(
/// \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);
/// \brief Casts a blueprint to an object.
/// \param blueprint The blueprint to cast.
/// \pre \li Must not be null.
/// \pre \li Must exist.
/// \param error_out \see errors.h
/// \return The blueprint represented as an object or null if an error occurs.
/// \remark This operation is guaranteed to be very fast and is intended to be used frequently.
IKA_API struct IkarusObject * ikarus_blueprint_to_object(IkarusBlueprint * blueprint, IkarusErrorData * error_out);
/// \see ikarus_blueprint_to_object
IKA_API struct IkarusObject const * ikarus_blueprint_to_object_const(IkarusBlueprint const * blueprint, IkarusErrorData * error_out);
IKARUS_END_HEADER
// @}