#include <bn_value_template_actions.h>
template<typename Value, typename Property, class PropertyManager>
cyclic_duration_by_value_template_action class
Modifies the property of a value by delta when the action is updated a given number of times. When the property is over the given maximum, it goes back to the given minimum 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
- cyclic_duration_by_value_template_action(const Value& value, int duration_updates, const Property& delta_property, const Property& min_property, const Property& after_max_property) protected
- Constructor.
- cyclic_duration_by_value_template_action(Value&& value, int duration_updates, const Property& delta_property, const Property& min_property, const Property& after_max_property) protected
- Constructor.
Public functions
- void reset()
- Resets the property to its initial state.
- void update()
- Adds delta_property to the property when the given amount of update calls are done.
- auto duration_updates() const -> int
- Returns how much times the action has to be updated before updating the property.
Protected functions
- auto value() const -> const Value&
- Returns the value to modify.
- auto delta_property() const -> const Property&
- Returns how much to add to the property when the action is updated the given number of times.
- void set_min_property(const Property& min_property)
- Sets the minimum property.
- void set_after_max_property(const Property& after_max_property)
- Sets the immediate amount after the maximum property.
Function documentation
template<typename Value, typename Property, class PropertyManager>
bn:: cyclic_duration_by_value_template_action<Value, Property, PropertyManager>:: cyclic_duration_by_value_template_action(const Value& value,
int duration_updates,
const Property& delta_property,
const Property& min_property,
const Property& after_max_property) protected
Constructor.
Parameters | |
---|---|
value | Value to copy. |
duration_updates | How much times the action has to be updated before updating the property. |
delta_property | How much to add to the property when the action is updated duration_updates times. |
min_property | Minimum property. |
after_max_property | Immediate amount after the maximum property. |
template<typename Value, typename Property, class PropertyManager>
bn:: cyclic_duration_by_value_template_action<Value, Property, PropertyManager>:: cyclic_duration_by_value_template_action(Value&& value,
int duration_updates,
const Property& delta_property,
const Property& min_property,
const Property& after_max_property) protected
Constructor.
Parameters | |
---|---|
value | Value to move. |
duration_updates | How much times the action has to be updated before updating the property. |
delta_property | How much to add to the property when the action is updated duration_updates times. |
min_property | Minimum property. |
after_max_property | Immediate amount after the maximum property. |
template<typename Value, typename Property, class PropertyManager>
void bn:: cyclic_duration_by_value_template_action<Value, Property, PropertyManager>:: update()
Adds delta_property to the property when the given amount of update calls are done.
When the property reaches the maximum, it goes back to the minimum and vice versa.