core config: Expose min/max ranges of integral settings and use it

This commit is contained in:
Eladash 2019-08-02 21:53:47 +03:00 committed by Ivan
parent a6c94a0eaf
commit 6d3fc3a386
3 changed files with 9 additions and 3 deletions

View file

@ -1,4 +1,4 @@
#pragma once
#pragma once
#include "Utilities/types.h"
#include "Utilities/StrFmt.h"
@ -235,6 +235,10 @@ namespace cfg
public:
int_type def;
// Expose range
static const s64 max = Max;
static const s64 min = Min;
_int(node* owner, const std::string& name, int_type def = std::min<int_type>(Max, std::max<int_type>(Min, 0)))
: _base(type::_int, owner, name)
, m_value(def)