from itertools import chain from generate.maps import sorted_map_headers def includes_header(): yield "#pragma once" yield "" yield '#include "maps.hpp"' yield "" def directions(): return set( # fixme: improve the connection parser # add dataclass fields connection[0] for map_header in sorted_map_headers() for connection in map_header.connections ) def struct_connection_t(): struct connection_t { enum direction { # directions for lulz }; enum direction direction; map_t::map map; uint8_t offset; }; def ():