remove property settings
Signed-off-by: Folling <mail@folling.io>
This commit is contained in:
parent
785e43d9e6
commit
62b8f1aef8
4 changed files with 0 additions and 186 deletions
|
|
@ -1,31 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
/// \file number_property_settings.h
|
||||
/// \author Folling <folling@ikarus.world>
|
||||
|
||||
#include <ikarus/macros.h>
|
||||
|
||||
/// \addtogroup property_settings PropertySettings
|
||||
/// \brief Number property settings add additional constraints to number properties.
|
||||
/// \details The following settings are available:
|
||||
///
|
||||
/// @{
|
||||
|
||||
IKARUS_BEGIN_HEADER
|
||||
|
||||
struct IkarusNumberPropertySettings;
|
||||
|
||||
/// \brief Sets the default value for a number property.
|
||||
/// \param settings The number property settings.
|
||||
/// \pre \li Must not be null.
|
||||
/// \param default_value The default value.
|
||||
/// \pre \li Must not be null.
|
||||
/// \pre \li Must be a valid value for the property.
|
||||
/// \remark The settings take ownership of the value, the caller must not free it.
|
||||
IKA_API void ikarus_number_property_settings_set_default_value(
|
||||
struct IkarusNumberPropertySettings * settings, struct IkarusNumberValue * default_value
|
||||
);
|
||||
|
||||
IKARUS_END_HEADER
|
||||
|
||||
/// @}
|
||||
|
|
@ -1,93 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
/// \file property_settings.h
|
||||
/// \author Folling <folling@ikarus.world>
|
||||
|
||||
#include <ikarus/macros.h>
|
||||
|
||||
/// \defgroup property_settings PropertySettings
|
||||
/// \brief Property settings add additional constraints to properties.
|
||||
/// \details Each property has a certain set of settings. The options available depend on the type of the property.
|
||||
/// Settings can be changed after the property has been created. Examples of settings are:
|
||||
/// Note that the default value must be set using the concrete subtypes to ascertain type correctness.
|
||||
/// - Minimum: The minimum value for a number property.
|
||||
/// - Matches: A regular expression that the value of a text property must match.
|
||||
/// There are also some common settings, shared among all properties:
|
||||
/// - Default Value (default: PropertyType's default default (sic) value): The value that is returned if no value is specified
|
||||
/// for some entity.
|
||||
/// - List (default: false): If set to true, the property becomes a list. Instead of one number, you could then specify a series
|
||||
/// of numbers. Note that each element in the list is subject to changes in values. E.g. when we say that all values are changed
|
||||
/// in some way (e.g. reset to the default value), this applies to all elements in the list.
|
||||
/// - Allow undefined (default: false): If set to true, you can specify an "unknown" value for a property.
|
||||
/// It might not be known if a character is dead or not for example.
|
||||
/// @{
|
||||
|
||||
IKARUS_BEGIN_HEADER
|
||||
|
||||
struct IkarusPropertySettings;
|
||||
|
||||
/// \brief Gets the default value of a property.
|
||||
/// \param settings The settings to get the default value of.
|
||||
/// \pre \li Must not be null.
|
||||
/// \pre \li Must exist.
|
||||
/// \return The default value of the property or null if an error occurs.
|
||||
/// \remark Must be freed using #ikarus_free.
|
||||
IKA_API struct IkarusValue const * ikarus_property_settings_get_default_value(IkarusPropertySettings const * settings);
|
||||
|
||||
/// \brief Fetches whether a property is a list.
|
||||
/// \param settings The property settings.
|
||||
/// \pre \li Must not be null.
|
||||
/// \return True if the property is a list, false otherwise.
|
||||
IKA_API bool ikarus_property_settings_is_list(IkarusPropertySettings const * settings);
|
||||
|
||||
/// \brief Sets whether a property is a list.
|
||||
/// \details Noop if unchanged. A change from list -> single truncates to just the first element. A change from single -> list
|
||||
/// sets the first element to the current value.
|
||||
/// \param settings The property settings.
|
||||
/// \pre \li Must not be null.
|
||||
/// \param list Whether the property should be
|
||||
/// a list.
|
||||
IKA_API void ikarus_property_settings_set_is_list(IkarusPropertySettings * settings, bool list);
|
||||
|
||||
/// \brief Fetches whether a property may be undefined.
|
||||
/// \param settings The property settings.
|
||||
/// \pre \li Must not be null.
|
||||
/// \return True if the property may be undefined, false otherwise.
|
||||
IKA_API bool ikarus_property_settings_may_be_undefined(IkarusPropertySettings const * settings);
|
||||
|
||||
/// \brief Sets whether a property may be undefined.
|
||||
/// \details Noop if unchanged. If the transition is from undefined -> defined, all undefined values will be reset to the
|
||||
/// default value.
|
||||
/// \param settings The property settings.
|
||||
/// \pre \li Must not be null.
|
||||
/// \param allow_undefined Whether the property should be allowed to be undefined.
|
||||
/// \param allow_undefined Whether the property should be allowed to be undefined.
|
||||
IKA_API void ikarus_property_settings_set_may_be_undefined(IkarusPropertySettings * settings, bool allow_undefined);
|
||||
|
||||
/// \brief Visits a property settings. Calling the appropriate function for the property's type.
|
||||
/// \param settings The property settings.
|
||||
/// \pre \li Must not be null.
|
||||
/// \param toggle_property_visitor The function to call if the property is a toggle property. Skipped if null.
|
||||
/// \param number_property_visitor The function to call if the property is a number property. Skipped if null.
|
||||
/// \param text_property_visitor The function to call if the property is a text property. Skipped if null.
|
||||
/// \param data Data passed to the visitors.
|
||||
IKA_API void ikarus_property_settings_visit(
|
||||
struct IkarusPropertySettings * settings,
|
||||
void (*toggle_property_visitor)(struct IkarusTogglePropertySettings * settings, void * data),
|
||||
void (*number_property_visitor)(struct IkarusNumberPropertySettings * settings, void * data),
|
||||
void (*text_property_visitor)(struct IkarusTextPropertySettings * settings, void * data),
|
||||
void * data
|
||||
);
|
||||
|
||||
/// \see ikarus_property_settings_visit
|
||||
IKA_API void ikarus_property_settings_visit_const(
|
||||
struct IkarusPropertySettings const * settings,
|
||||
void (*toggle_property_visitor)(struct IkarusTogglePropertySettings const * settings, void * data),
|
||||
void (*number_property_visitor)(struct IkarusNumberPropertySettings const * settings, void * data),
|
||||
void (*text_property_visitor)(struct IkarusTextPropertySettings const * settings, void * data),
|
||||
void * data
|
||||
);
|
||||
|
||||
IKARUS_END_HEADER
|
||||
|
||||
/// @}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
/// \file text_property_settings.h
|
||||
/// \author Folling <folling@ikarus.world>
|
||||
|
||||
#include <ikarus/macros.h>
|
||||
|
||||
/// \addtogroup property_settings PropertySettings
|
||||
/// \brief Text property settings add additional constraints to text properties.
|
||||
/// \details The following settings are available:
|
||||
///
|
||||
/// @{
|
||||
|
||||
IKARUS_BEGIN_HEADER
|
||||
|
||||
struct IkarusTextPropertySettings;
|
||||
|
||||
/// \brief Sets the default value for a text property.
|
||||
/// \param settings The text property settings.
|
||||
/// \pre \li Must not be null.
|
||||
/// \param default_value The default value.
|
||||
/// \pre \li Must not be null.
|
||||
/// \pre \li Must be a valid value for the property.
|
||||
/// \remark The settings take ownership of the value, the caller must not free it.
|
||||
IKA_API void ikarus_text_property_settings_set_default_value(
|
||||
struct IkarusTextPropertySettings * settings, struct IkarusTextValue * default_value
|
||||
);
|
||||
|
||||
IKARUS_END_HEADER
|
||||
|
||||
/// @}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
/// \file toggle_property_settings.h
|
||||
/// \author Folling <folling@ikarus.world>
|
||||
|
||||
#include <ikarus/macros.h>
|
||||
|
||||
/// \addtogroup property_settings PropertySettings
|
||||
/// \brief Toggle property settings add additional constraints to toggle properties.
|
||||
/// \details The following settings are available:
|
||||
///
|
||||
/// @{
|
||||
|
||||
IKARUS_BEGIN_HEADER
|
||||
|
||||
struct IkarusTogglePropertySettings;
|
||||
|
||||
/// \brief Sets the default value for a toggle property.
|
||||
/// \param settings The toggle property settings.
|
||||
/// \pre \li Must not be null.
|
||||
/// \param default_value The default value.
|
||||
/// \pre \li Must not be null.
|
||||
/// \pre \li Must be a valid value for the property.
|
||||
/// \remark The settings take ownership of the value, the caller must not free it.
|
||||
IKA_API void ikarus_toggle_property_settings_set_default_value(
|
||||
struct IkarusTogglePropertySettings * settings, struct IkarusToggleValue * default_value
|
||||
);
|
||||
|
||||
IKARUS_END_HEADER
|
||||
|
||||
/// @}
|
||||
Loading…
Add table
Add a link
Reference in a new issue