10 static_assert(std::is_arithmetic<T>::value);
15 property() : m_property(
T()), m_min(0), m_max(1) {}
17 property(
T value) : m_property(value), m_min(value), m_max(value + 1) {}
19 property(
T value,
T min,
T max) : m_property(value), m_min(min), m_max(max)
30 : m_property(
other.m_property), m_min(
other.m_min), m_max(
other.m_max), m_delegate(
other.m_delegate)
53 m_property =
other.m_property;
56 m_delegate =
other.m_delegate;
66 if (value != m_property)
68 if (value >= m_min && value <= m_max)
70 m_delegate.Broadcast(m_property, value);
76 [[nodiscard]] T get()
const {
return m_property; }
77 property_changed_delegate& get_delegate() {
return m_delegate; }
78 [[nodiscard]] T get_min()
const {
return m_min; }
79 [[nodiscard]] T get_max()
const {
return m_max; }
80 [[nodiscard]] std::pair<T, T> get_min_max_pair()
const {
return std::pair<T, T>(m_min, m_max); }
86 property_changed_delegate m_delegate;