PlusCountdownRegulator.hpp

Regulator that modifies match distance through addition and decays to baseline with a countdown timer.

template<typename Slope = std::deci>
struct PlusCountdownRegulator
#include <PlusCountdownRegulator.hpp>

Public Types

using set_t = float
using adj_t = float
using view_t = float

Public Functions

inline bool Set(const float &set)

A positive value downregulates the item, a value of zero is neutral, and a negative value upregulates the item.

inline bool Adj(const float &amt)

A negative value upregulates the item, a value of exactly zero is neutral and a postive value downregulates the item.

inline bool Decay(const int steps)

Timer decay. Return whether MatchBin should be updated

inline const float &View() const

Return a float representing the state of the regulator.

Public Members

float state = {}
unsigned char timer = {}

Public Static Attributes

static constexpr float slope = (static_cast<float>(Slope::num) / static_cast<float>(Slope::den))