const ARC_POSITION_CLASSES = [ ["poker-seat-arc-center"], ["poker-seat-arc-left", "poker-seat-arc-right"], ["poker-seat-arc-left", "poker-seat-arc-center", "poker-seat-arc-right"], [ "poker-seat-arc-far-left", "poker-seat-arc-center-left", "poker-seat-arc-center-right", "poker-seat-arc-far-right", ], ] as const; export function seatPosition(opponentIndex: number, opponentCount: number): string { const normalizedCount = Math.min(ARC_POSITION_CLASSES.length, Math.max(1, opponentCount)); const positions = ARC_POSITION_CLASSES[normalizedCount - 1] ?? ARC_POSITION_CLASSES[0]; const normalizedIndex = Math.min(positions.length - 1, Math.max(0, opponentIndex)); return positions[normalizedIndex] ?? positions[0] ?? "poker-seat-arc-center"; } const TOP_SEAT_CLASSES = new Set([ "poker-seat-arc-center", "poker-seat-arc-center-left", "poker-seat-arc-center-right", ]); export function isTopSeatPosition(positionClass: string): boolean { return TOP_SEAT_CLASSES.has(positionClass); }