11 static_assert(std::is_arithmetic<T>::value);
17 Property() : m_property(
T()), m_min(0), m_max(1) {}
19 Property(
T value) : m_property(value), m_min(value), m_max(value + 1) {}
21 Property(
T value,
T min,
T max) : m_property(value), m_min(min), m_max(max)
32 : m_property(
other.m_property), m_min(
other.m_min), m_max(
other.m_max), m_delegate(
other.m_delegate)
54 m_property =
other.m_property;
57 m_delegate =
other.m_delegate;
68 if (value != m_property)
70 if (value >= m_min && value <= m_max)
72 m_delegate.Broadcast(m_property, value);
78 [[nodiscard]] T get()
const {
return m_property; }
80 PropertyChangedDelegate& getDelegate() {
return m_delegate; }
82 [[nodiscard]] T getMin()
const {
return m_min; }
84 [[nodiscard]] T getMax()
const {
return m_max; }
86 [[nodiscard]] std::pair<T, T> getMinMaxPair()
const {
return std::pair<T, T>(m_min, m_max); }
92 PropertyChangedDelegate m_delegate;