tess 1.0.0
Performance-first tile and path simulation substrate
Loading...
Searching...
No Matches
lattice.h
1#pragma once
2
3#include <concepts>
4#include <cstdint>
5
6namespace tess::lattice {
7
9enum class Identity : std::uint32_t {
10 Orthogonal = 0x4f525448,
11 HexAxial = 0x48455841,
12};
13
15struct Orthogonal {
16 static constexpr Identity identity = Identity::Orthogonal;
17 static constexpr std::uint32_t version = 1;
18
19 template <auto Size, auto Chunk>
20 static constexpr bool valid_shape = true;
21};
22
24struct HexAxial {
25 static constexpr Identity identity = Identity::HexAxial;
26 static constexpr std::uint32_t version = 1;
27
28 template <auto Size, auto Chunk>
29 static constexpr bool valid_shape = Size.z == 1 && Chunk.z == 1;
30};
31
33template <typename T>
34concept LatticeType = requires {
35 { T::identity } -> std::convertible_to<Identity>;
36 { T::version } -> std::convertible_to<std::uint32_t>;
37};
38
39} // namespace tess::lattice
Definition lattice.h:34
Definition lattice.h:24
Definition lattice.h:15