#include <bn_template_actions.h>
template<typename Property, class PropertyManager>
cyclic_by_template_action class
Modifies the property by delta from a minimum to a maximum. When the property is over the given maximum, it goes back to the given minimum and vice versa.
Template parameters | |
---|---|
Property | Property to modify. |
PropertyManager | Reads and writes the property to modify. |
Constructors, destructors, conversion operators
- cyclic_by_template_action(const Property& delta_property, const Property& min_property, const Property& after_max_property) protected
- Constructor.
Public functions
Protected functions
- auto delta_property() const -> const Property&
- Returns how much to add to the property when the action is updated.
- 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 Property, class PropertyManager>
bn:: cyclic_by_template_action<Property, PropertyManager>:: cyclic_by_template_action(const Property& delta_property,
const Property& min_property,
const Property& after_max_property) protected
Constructor.
Parameters | |
---|---|
delta_property | How much to add to the property when the action is updated. |
min_property | Minimum property. |
after_max_property | Immediate amount after the maximum property. |
template<typename Property, class PropertyManager>
void bn:: cyclic_by_template_action<Property, PropertyManager>:: update()
Adds delta_property to the property.
When the property reaches the maximum, it goes back to the minimum and vice versa.