1
0
Fork 0
polaris-task-force/src/components/frontend/minigames/poker/seatPosition.ts
Z8MB1E 16a44d3fc5 feat(poker): redesign felt as diegetic oval with toolbar and viewer cards
The table becomes a full oval racetrack with a center deck and pot plaque, perimeter seats as compact pills with stack-first readouts that flash on change, betting actions mounted on the felt near the viewer, your own cards dealt onto the bottom rail at community-card size, directional popups, and gated start and waiting-room polish.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-09-11 17:07:28 -04:00

28 lines
1 KiB
TypeScript

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<string>([
"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);
}