Sound Bakery  v0.1.0
Open-source audio middleware for games
|
Holds discrete named integer values. More...
#include <parameter.h>
Public Member Functions | |
named_parameter () | |
Creates a named_parameter with min and max values. | |
sbk::core::database_ptr< named_parameter_value > | add_new_value (const std::string_view name) |
Adds a new value to the parameter. | |
std::unordered_set< sbk::core::database_ptr< named_parameter_value > > | get_values () |
Gets all named values in this parameter. | |
void | set_selected_value (sbk::core::database_ptr< named_parameter_value > value) |
Sets the parameter value with a DatabasePtr, ensuring the value exists in this parameter. | |
sbk::core::database_ptr< named_parameter_value > | get_selected_value () const |
Get the selected value as a DatabasePtr. | |
Public Member Functions inherited from sbk::engine::parameter< sbk_id > | |
parameter (sbk_id min, sbk_id max) | |
Creates a parameter with min and max values set. | |
sbk_id | get () const |
Get the current value of the parameter. | |
sbk_id | get_default () const |
void | set (sbk_id value) |
Set the value of the parameter. | |
void | set_default (sbk_id value) |
parameter_property::property_changed_delegate & | get_delegate () |
Get the parameter delegate that fires when changing the value. | |
local_parameter | create_local_parameter_from_this () const |
Copies this parameter to a runtime version, suitable for handling unique variations per game object etc. | |
Public Member Functions inherited from sbk::core::database_object | |
sbk_id | get_database_id () const |
void | set_database_id (sbk_id id) |
std::string_view | get_database_name () const |
void | set_database_name (std::string_view name) |
bool | get_editor_hidden () const |
void | set_editor_hidden (bool hidden) |
operator sbk_id () const | |
MulticastDelegate< sbk_id, sbk_id > & | get_on_update_id () |
MulticastDelegate< std::string_view, std::string_view > & | get_on_update_name () |
Public Member Functions inherited from sbk::core::object | |
object_owner * | owner () const |
template<typename T > | |
T * | try_convert_object () noexcept |
Gets the most derived type of this object and upcasts it to T. | |
template<typename T > | |
const T * | try_convert_object () const noexcept |
rttr::type | getType () const |
void | destroy () |
MulticastDelegate< object * > & | get_on_destroy () |
Public Member Functions inherited from sbk::core::object_owner | |
std::shared_ptr< object > | create_runtime_object (const rttr::type &type) |
std::shared_ptr< object > | load_object (YAML::Node &node) |
std::shared_ptr< database_object > | create_database_object (const rttr::type &type, bool addToDatabase=true) |
template<typename T > | |
std::shared_ptr< T > | create_runtime_object () |
template<typename T > | |
std::shared_ptr< T > | create_database_object () |
void | remove_object (const std::shared_ptr< object > &object) |
void | destroy_all () |
std::vector< std::shared_ptr< object > > & | get_objects () |
const std::vector< std::shared_ptr< object > > & | get_objects () const |
Additional Inherited Members | |
Public Types inherited from sbk::engine::parameter< sbk_id > | |
using | parameter_property = sbk::core::property< sbk_id > |
Defines the underlying property type used to store and broadcast values. | |
using | local_parameter = std::pair< sbk_id, parameter_property > |
Defines the type used for passing local versions/variations of this parameter. | |
using | local_parameter_value_pair = std::pair< sbk_id, sbk_id > |
Defines an ID to a parameter and a value for that parameter. | |
Holds discrete named integer values.
Each named_parameter_value is a database object, therefore holding a unique ID.
The named_parameter stores the unique id as its parameter value.
|
inline |
Creates a named_parameter with min and max values.
|
inline |
Adds a new value to the parameter.
name | Name of the parameter value |
|
inline |
Get the selected value as a DatabasePtr.
Mainly used in reflection and for displaying in the editor.
|
inline |
Gets all named values in this parameter.
If none exists, ensures at least the "None" value exists.
|
inline |
Sets the parameter value with a DatabasePtr, ensuring the value exists in this parameter.
Internally sets the parameter with the DatabasePtr's ID.
value |