import Database from 'better-sqlite3'; import { Tile } from '../../schema/tile.js'; export declare class TileRepository { private db; constructor(db: Database.Database); create(tile: Tile): void; /** * Create multiple tiles in a single transaction. * Uses prepared statement batching for optimal performance during worldgen. * * @param tiles - Array of tiles to create * @returns Number of tiles created * * @example * // Create 10,000 tiles from worldgen data * const tiles = []; * for (let y = 0; y < 100; y++) { * for (let x = 0; x < 100; x++) { * tiles.push({ * id: `tile-${x}-${y}`, * worldId: 'world-1', * x, y, * biome: biomes[y][x], * elevation: elevation[y * 100 + x], * moisture: moisture[y * 100 + x] / 100, * temperature: temperature[y * 100 + x] * }); * } * } * tileRepo.createBatch(tiles); // ~50x faster than individual inserts */ createBatch(tiles: Tile[]): number; /** * Create tiles from worldgen data arrays efficiently. * Directly maps array indices to tile coordinates. * * @param worldId - World ID * @param width - World width * @param height - World height * @param biomes - 2D biome array [y][x] * @param elevation - Flat elevation array (y * width + x) * @param moisture - Flat moisture array (y * width + x), values 0-100 * @param temperature - Flat temperature array (y * width + x) * @param idPrefix - Optional ID prefix (default: 'tile') * @returns Number of tiles created */ createFromWorldgen(worldId: string, width: number, height: number, biomes: string[][], elevation: Uint8Array | number[], moisture: Uint8Array | number[], temperature: Int8Array | number[], idPrefix?: string): number; /** * Delete all tiles for a world (useful before regenerating) */ deleteByWorldId(worldId: string): number; findByCoordinates(worldId: string, x: number, y: number): Tile | null; findByWorldId(worldId: string): Tile[]; } //# sourceMappingURL=tile.repo.d.ts.map