27#include "guillaume/ecs/component.hpp"
62 using Handler = std::function<void(
float,
float)>;
192 float sanitize(
float value)
const;
203 void apply(
float low,
float high);
Handler getOnChangedHandler(void) const
Get the callback run when the interval changes.
Range(void)=default
Create the interval 0 to 1 in the range 0 to 1, without snapping.
Range & setStep(float step)
Set the snapping step.
float getLow(void) const
Get the low end of the interval.
std::function< void(float, float)> Handler
Callback receiving the new low and high ends, in that order.
float getStep(void) const
Get the snapping step.
Range & setOnChangedHandler(const Handler &handler)
Set the callback run when the interval changes.
float getMin(void) const
Get the lower bound of the range.
Range & setMin(float min)
Set the lower bound of the range.
float getMax(void) const
Get the upper bound of the range.
Range & setLow(float low)
Set the low end of the interval.
Range & setMax(float max)
Set the upper bound of the range.
~Range(void)=default
Default destructor for the Range component.
float getHigh(void) const
Get the high end of the interval.
Range & setHigh(float high)
Set the high end of the interval.
Base class of every component: a piece of state attached to an entity, plus a "changed" flag.
State. Every class here is plain data attached to an entity.