bgen/godot/src/grid_to_dict.h

23 lines
686 B
C
Raw Normal View History

2026-04-16 21:04:50 -04:00
#pragma once
#include <godot_cpp/variant/dictionary.hpp>
#include <godot_cpp/variant/vector2i.hpp>
extern "C" {
#include "gen/grid.h"
}
namespace godot {
/* Pack a grid_t into a Dictionary with the shape documented in the plugin
README (terrain/liquid/flags/room_id/machine_id/surface arrays). Used by
both BrogueGen.generate() and BrogueReplay.get_grid(). Additional
metadata (rooms, machines, chokepoints, stairs) are computed and added
when add_metadata is true. */
Dictionary grid_to_dictionary(grid_t g, int seed, int depth, bool add_metadata);
/* Pack a single cell as a Dictionary. */
Dictionary cell_to_dictionary(grid_t g, int x, int y);
} // namespace godot