37 lines
No EOL
599 B
TypeScript
37 lines
No EOL
599 B
TypeScript
import type { SpecialCardType } from "./cards"
|
|
|
|
type PlayerAction = {
|
|
initiatingPlayerId: string
|
|
} & (
|
|
| {
|
|
type: "draw"
|
|
}
|
|
| {
|
|
type: "stay"
|
|
}
|
|
| {
|
|
type: "use-special"
|
|
cardType: SpecialCardType
|
|
}
|
|
)
|
|
|
|
type ServerAction =
|
|
| {
|
|
type: "start"
|
|
numberCardsByPlayerId: Record<string, number[]> // if redacted: only contains the player themself
|
|
targetSum: number
|
|
}
|
|
| {
|
|
type: "deal-number"
|
|
toPlayerId: string
|
|
number: number
|
|
}
|
|
| {
|
|
type: "deal-special"
|
|
toPlayerId: string
|
|
cardType: SpecialCardType
|
|
}
|
|
|
|
export type GameAction = {
|
|
index: number
|
|
} & (PlayerAction | ServerAction) |