import { Vec3 } from 'cc';
import { LevelConfig } from './LevelTypes';

/** 关卡运行时上下文（避免 TileLayout ↔ GameController 循环依赖） */
export interface LevelRuntimeContext {
    getCurLevel(): LevelConfig | null;
    worldToCell(world: Vec3): Vec3;
}

let runtimeContext: LevelRuntimeContext | null = null;

export function setLevelRuntimeContext(ctx: LevelRuntimeContext | null): void {
    runtimeContext = ctx;
}

export function getLevelRuntimeContext(): LevelRuntimeContext | null {
    return runtimeContext;
}
