blob: 4d38f456d0d6698085908756532efcbb08f7aedd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
#pragma once
#include <Corrade/Containers/StringView.h>
#include <Magnum/Math/Vector4.h>
namespace floormat::entities::erased_constraints {
struct range final
{
using U = size_t;
using I = std::make_signed_t<U>;
enum type_ : unsigned char {
type_none,
type_float, type_uint, type_int,
type_float4, type_uint4, type_int4,
};
union element {
float f;
U u;
I i;
Math::Vector4<float> f4;
Math::Vector4<U> u4;
Math::Vector4<I> i4;
};
element min {.i = 0}, max {.i = 0};
type_ type = type_none;
template<typename T> std::pair<T, T> convert() const;
friend bool operator==(const range& a, const range& b);
};
struct max_length final {
size_t value = size_t(-1);
constexpr operator size_t() const { return value; }
};
struct group final {
StringView group_name;
constexpr operator StringView() const { return group_name; }
constexpr group() = default;
constexpr group(StringView name) : group_name{name} {}
};
} // namespace floormat::entities::erased_constraints
|