#ifndef JSON_EMIT_H
#define JSON_EMIT_H

#include <stdint.h>
#include "gen/grid.h"

/* Emit the grid as a single JSON object to stdout. Layout mirrors the
 * Dictionary produced by godot/src/grid_to_dict.cpp so the CLI and the
 * GDExtension expose the same schema. Byte layers are base64-encoded;
 * the flags layer is emitted as base64 of width*height little-endian
 * int32 values.
 */
void emit_grid_json(grid_t g, uint64_t seed, int depth);

#endif
