import { Box2, Box3, Vector2, Vector3 } from 'three'; import { PatchKey } from '../utils/common_types.js'; import { DataContainer, PatchBase, PatchElement } from '../datacontainers/PatchBase.js'; import { WorldLocals } from '../config/WorldEnv.js'; import { ChunkBlocksContainer, SpawnChunk } from '../factory/ChunksFactory.js'; import { WorkerPool } from './WorkerPool.js'; export declare enum BlockCategory { EMPTY = 0, FLAT = 1, HOLE = 2, OBSTACLE = 3 } export type BoardStub = { bounds: Box2; content: Uint8Array; elevation?: number; }; export type BoardCacheData = { chunks: ChunkBlocksContainer[]; items: SpawnChunk[]; }; declare class BoardPatch extends PatchBase implements DataContainer { rawData: Uint8Array; constructor(bounds: Box2, margin?: number); toStub(): BoardStub; iterDataQuery(globalBounds?: Box2 | undefined, includeMargins?: boolean, skipEmpty?: boolean): Generator, void, unknown>; containsPoint(pos: Vector2): boolean; } /** * Handle chunks and items tasks and provide data required to build board content: */ export declare class BoardCacheProvider { workerPool: WorkerPool; worldLocalEnv: WorldLocals; localCache: BoardCacheData; patchRange: Box2; patchIndex: Record; pendingBoardGen: boolean; constructor(workerPool: WorkerPool, worldLocalEnv: WorldLocals); get patchKeys(): string[]; get chunkIds(): import("three").Vector3Like[]; get chunks(): ChunkBlocksContainer[]; get items(): SpawnChunk[]; /** * call each time cache board params changes */ loadData: (center: Vector2, radius: number) => Promise; /** * fills target chunk from cache */ fillTargetChunk(targetChunk: ChunkBlocksContainer): void; getSpawnedItems(bounds: Box3): SpawnChunk[]; } type BoardContent = { chunk: ChunkBlocksContainer; patch: BoardPatch; }; /** * Call: * - `start` to create unique board instance at specific location * - `terminate` to remove board instance */ export declare class BoardProvider { cacheProvider: BoardCacheProvider; boardCenter: Vector3; finalBounds: Box2; boardData: BoardPatch; worldLocalEnv: WorldLocals; constructor(boardCenter: Vector3, cacheProvider: BoardCacheProvider, worldLocalEnv: WorldLocals); get boardThickness(): number; get boardRadius(): number; get centerPatchId(): Vector2; get patchRange(): number; get initialDims(): Vector3; get initialBounds(): Box3; get boardElevation(): number; get groundCenter(): Vector2; isWithinBoard(buffPos: Vector2, buffer: Uint16Array): boolean; overlapsBoard(bounds: Box2): boolean; get nonOverlappingItemsChunks(): SpawnChunk[]; overrideHeightBuffer: (heightBuff: Uint16Array, isHoleBlock: boolean) => Uint16Array; genBoardContent(skipHoleBlocks?: boolean): Promise; addTrimmedItems(boardPatch: BoardPatch, boardChunk: ChunkBlocksContainer, boardSpawnedItems: SpawnChunk[]): void; overrideOriginalChunksContent(boardChunk: ChunkBlocksContainer): Generator; restoreOriginalChunksContent(): Generator; } export {};