libikarus/include/ikarus/objects/properties/number_property.h
2025-04-15 12:10:42 +02:00

42 lines
1.4 KiB
C

#pragma once
/// \file number_property.h
/// \author Folling <folling@ikarus.world>
#include <ikarus/macros.h>
/// \addtogroup properties Properties
/// \brief Number properties store a numeric value. (e.g. "Weight" or "Age")
/// @{
IKARUS_BEGIN_HEADER
struct IkarusNumberProperty;
IKA_API IkarusNumberProperty * ikarus_number_property_create(
struct IkarusProject * project, char const * name, struct IkarusPropertySource * property_source
);
/// \brief Sets the default value for a number property.
/// \param property The number property.
/// \pre \li Must not be null.
/// \pre \li Must exist.
/// \remark The settings take ownership of the value, the caller must not free it.
IKA_API struct IkarusNumberValue * ikarus_number_property_get_default_value(struct IkarusNumberProperty * property);
/// \brief Sets the default value for a number property.
/// \param property The number property.
/// \pre \li Must not be null.
/// \pre \li Must exist.
/// \param default_value The default value.
/// \pre \li Must not be null.
/// \pre \li Must be a valid value for the property.
/// \remark Please see \ref property.h "the property documentation" for more information on the interplay between default values
/// and other settings.
IKA_API void ikarus_number_property_set_default_value(
struct IkarusNumberProperty * property, struct IkarusNumberValue * default_value
);
IKARUS_END_HEADER
/// @}