template<typename Value, typename Property, class PropertyManager>
bn::to_value_template_action class

Modifies the property of a value until it has a given state.

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

to_value_template_action(const Value& value, int duration_updates, const Property& final_property) protected
Constructor.
to_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 ((final_property - initial_property) / duration_updates) to the property until it is equal to final_property.
auto done() const -> bool
Indicates if the action must not be updated anymore.
auto duration_updates() const -> int
Returns the number of times that the action must be updated until the property is equal to final_property.

Protected functions

auto value() const -> const Value&
Returns the value to modify.
auto final_property() const -> const Property&
Returns the state of property when the action is updated the given number of times.

Function documentation

template<typename Value, typename Property, class PropertyManager>
bn::to_value_template_action<Value, Property, PropertyManager>::to_value_template_action(const Value& value, int duration_updates, const Property& final_property) protected

Constructor.

Parameters
value Value to copy.
duration_updates Number of times that the action must be updated until the property is equal to final_property.
final_property Property when the action is updated duration_updates times.

template<typename Value, typename Property, class PropertyManager>
bn::to_value_template_action<Value, Property, PropertyManager>::to_value_template_action(Value&& value, int duration_updates, const Property& final_property) protected

Constructor.

Parameters
value Value to move.
duration_updates Number of times that the action must be updated until the property is equal to final_property.
final_property Property when the action is updated duration_updates times.