#include <bn_value_template_actions.h>
template<typename Value, typename Property, class PropertyManager>
loop_value_template_action class
Modifies the property of a value by delta from a minimum to a maximum. When the property is equal to the given final state, it goes back to its initial state and vice versa.
Template parameters | |
---|---|
Value | Value to modify. |
Property | Property of the value to modify. |
PropertyManager | Reads and writes the property of the value to modify. |
Constructors, destructors, conversion operators
- loop_value_template_action(const Value& value, int duration_updates, const Property& final_property) protected
- Constructor.
- loop_value_template_action(Value&& value, int duration_updates, const Property& final_property) protected
- Constructor.
Public functions
- void reset()
- Resets the property to its initial state.
- void update()
- Adds or subtracts ((final_property - initial_property) / duration_updates) to the property.
- auto duration_updates() const -> int
- Returns how much times the action has to be updated before changing the direction of the property delta.
Protected functions
- auto value() const -> const Value&
- Returns the value to modify.
- auto final_property() const -> const Property&
- When the property is equal to the returned parameter, it goes back to its initial state and vice versa.
Function documentation
template<typename Value, typename Property, class PropertyManager>
bn:: loop_value_template_action<Value, Property, PropertyManager>:: loop_value_template_action(const Value& value,
int duration_updates,
const Property& final_property) protected
Constructor.
Parameters | |
---|---|
value | Value to copy. |
duration_updates | How much times the action has to be updated before changing the direction of the property delta. |
final_property | When the property is equal to this parameter, it goes back to its initial state and vice versa. |
template<typename Value, typename Property, class PropertyManager>
bn:: loop_value_template_action<Value, Property, PropertyManager>:: loop_value_template_action(Value&& value,
int duration_updates,
const Property& final_property) protected
Constructor.
Parameters | |
---|---|
value | Value to move. |
duration_updates | How much times the action has to be updated before changing the direction of the property delta. |
final_property | When the property is equal to this parameter, it goes back to its initial state and vice versa. |
template<typename Value, typename Property, class PropertyManager>
void bn:: loop_value_template_action<Value, Property, PropertyManager>:: update()
Adds or subtracts ((final_property - initial_property) / duration_updates) to the property.
When the property is equal to final_property, it goes back to its initial state and vice versa.