import type { JellyFillDefinition } from './JellyFill'; export type FillContainerKind = 'standard' | 'wide' | 'tall'; export const FILL_CONTAINERS = { standard:{halfWidth:0.8,halfDepth:0.65,wallHeight:1.45}, wide:{halfWidth:1.0,halfDepth:0.65,wallHeight:1.1}, tall:{halfWidth:0.68,halfDepth:0.63,wallHeight:1.7}, } as const; export const fillContainerLayout = (kind: FillContainerKind = 'standard') => FILL_CONTAINERS[kind]; /** 낮은 통은 반 분량이다. 모양과 목표를 미리 확정해 교체 도중 규칙을 바꾸지 않는다. */ export function fillContainerDefinitions(definition: JellyFillDefinition): JellyFillDefinition[] { const sequence=definition.containerShapes??[definition.containerShape??'standard']; if(!sequence.length || sequence.length>12 || sequence.some(k=>!Object.hasOwn(FILL_CONTAINERS,k)))throw new Error('공장 통 모양 순서가 유효하지 않음'); return Array.from({length:definition.containers??1},(_,i)=>{ const containerShape=sequence[i%sequence.length]; return {...definition,containerShape,target:definition.target*(containerShape==='wide'?0.5:1)}; }); }