Update dependencies and fix issues
This commit is contained in:
parent
a200b46764
commit
14f4e87d9d
49 changed files with 3432 additions and 2757 deletions
54
shared/game/actions.ts
Normal file
54
shared/game/actions.ts
Normal file
|
@ -0,0 +1,54 @@
|
|||
import type { SpecialCardId } from "./cards"
|
||||
|
||||
type PlayerAction = {
|
||||
initiatingPlayerId: string
|
||||
} & (
|
||||
| {
|
||||
type: "join"
|
||||
name: string
|
||||
}
|
||||
| {
|
||||
type: "hit"
|
||||
}
|
||||
| {
|
||||
type: "stay"
|
||||
}
|
||||
| {
|
||||
type: "use-special"
|
||||
cardId: SpecialCardId
|
||||
}
|
||||
| {
|
||||
type: "leave"
|
||||
}
|
||||
)
|
||||
|
||||
type ServerAction = {
|
||||
initiatingPlayerId?: never
|
||||
} & (
|
||||
| {
|
||||
type: "start"
|
||||
targetSum: number
|
||||
startingPlayerId: string
|
||||
}
|
||||
| {
|
||||
type: "deal-number"
|
||||
toPlayerId: string
|
||||
number: number
|
||||
isCovert: boolean
|
||||
}
|
||||
| {
|
||||
type: "deal-special"
|
||||
toPlayerId: string
|
||||
cardId?: SpecialCardId // undefined if redacted
|
||||
}
|
||||
| {
|
||||
type: "end"
|
||||
winnerIds: string[]
|
||||
cardsByPlayerId: Record<string, number[]> // without redactions
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
export type GameAction = {
|
||||
index: number
|
||||
} & (PlayerAction | ServerAction)
|
Loading…
Add table
Add a link
Reference in a new issue