#pragma once /// \file property_source.h /// \author Folling #include #include /// \addtogroup properties Properties /// @{ IKARUS_BEGIN_HEADER struct IkarusPropertyScope; /// \brief Creates an blueprint property source. /// \param blueprint The blueprint to create the property source for. /// \pre \li Must not be null. /// \pre \li Must exist. /// \param error_out \see errors.h /// \return The created property source or null if an error occurs. /// \remark Must be freed using #ikarus_free. IKA_API struct IkarusPropertyScope * ikarus_property_source_create_blueprint(struct IkarusBlueprint * blueprint, IkarusErrorData * error_out); /// \brief Creates an entity property source. /// \param entity The entity to create the property source for. /// \pre \li Must not be null. /// \pre \li Must exist. /// \param error_out \see errors.h /// \return The created property source or null if an error occurs. /// \remark Must be freed using #ikarus_free. IKA_API struct IkarusPropertyScope * ikarus_property_source_create_entity(struct IkarusEntity * entity, IkarusErrorData * error_out); /// \brief Visits a property source, calling the appropriate callback. /// \param property_source The property source to visit. /// \pre \li Must not be null. /// \pre \li Must exist. /// \param blueprint_visitor The callback to call if the source is a blueprint, skipped if null. /// \param entity_visitor The callback to call if the source is an entity, skipped if null. /// \param user_data User data to pass to the callbacks. /// \param error_out \see errors.h IKA_API void ikarus_property_source_visit( struct IkarusPropertyScope * property_source, void (*blueprint_visitor)(struct IkarusBlueprint *, void *), void (*entity_visitor)(struct IkarusEntity *, void *), void * user_data, IkarusErrorData * error_out ); /// \see ikarus_property_source_visit IKA_API void ikarus_property_source_visit_const( struct IkarusPropertyScope const * property_source, void (*blueprint_visitor)(struct IkarusBlueprint const *, void *), void (*entity_visitor)(struct IkarusEntity const *, void *), void * user_data, IkarusErrorData * error_out ); IKARUS_END_HEADER /// @}