#pragma once

#include <godot_cpp/variant/dictionary.hpp>
#include <godot_cpp/variant/typed_array.hpp>

extern "C" {
#include "blobber/dungeon.h"
#include "mesh/face_mesh.h"
}

namespace godot {

/* Pack dungeon_t + mesh_build_t into a Dictionary suitable for return from
   BrogueGen.generate_dungeon(). Keys: seed, num_levels, dimensions,
   cell_size, cells (PackedByteArray of raw cell3d_t), meshes
   (Array of per-material surface arrays), levels (metadata), plan (empty
   for PR 1). */
Dictionary dungeon_to_dictionary(const dungeon_t *d, const mesh_build_t *mb,
                                 int seed, int depth, int num_levels);

/* Flatten a 3D blobber dungeon into an Array of per-level 2D slices shaped
   like legacy brogue's grid_to_dictionary() output: each entry is a
   Dictionary with {width, height, terrain: PackedByteArray,
   liquid: PackedByteArray}. Terrain / liquid values match the T_* / L_*
   enums in src/gen/grid.h so the existing .map exporter can consume them. */
TypedArray<Dictionary> dungeon_to_2d_slices(const dungeon_t *d);

} // namespace godot
