import { getThemeTilePivot } from './TileDisplayMeta';

/** 与 Unity Texture/*.png.meta 中 spritePivot 一致（无主题数据时的回退） */
export interface TilePivot {
    x: number;
    y: number;
}

const DEFAULT_PIVOTS: Record<string, TilePivot> = {
    Baseblock: { x: 0.5, y: 0.92 },
    JumpBlock: { x: 0.5, y: 0.77 },
    WallBlock: { x: 0.5, y: 0.67 },
    kuai11: { x: 0.5, y: 1.01 },
    Decor23: { x: 0.5, y: 0.92 },
    '素材切图-23': { x: 0.5, y: 0.92 },
    '素材切图2-23': { x: 0.5, y: 0.92 },
    '小游戏素材红色_03': { x: 0.5, y: 0.92 },
};

export function getTilePivot(tileName: string, theme?: string): TilePivot {
    const fallback = DEFAULT_PIVOTS[tileName] ?? { x: 0.5, y: 0.92 };
    return getThemeTilePivot(theme, tileName, fallback);
}
