events.go (1735B)
1 package poker 2 3 import ( 4 "dkforest/pkg/database" 5 "time" 6 ) 7 8 type PokerEvent struct { 9 ID int 10 // ID1 is the ID of the next card in the stack. 11 // We need to pre-set it's z-index because z-index and transform are not working properly together. 12 // And the z-index is actually set once the transform is completed. 13 // So this hack makes it look like the next card from the stack move over the other cards... 14 ID1 int 15 ZIdx int 16 Name string 17 Top int 18 Left int 19 Reveal bool 20 Angle string 21 UserID database.UserID 22 } 23 24 type GameStartedEvent struct { 25 DealerSeatIdx int 26 } 27 28 type GameIsOverEvent struct{} 29 30 type GameIsDoneEvent struct { 31 Winner string 32 WinnerHand string 33 } 34 35 type ResetCardsEvent struct { 36 } 37 38 type CashBonusEvent struct { 39 PlayerSeatIdx int 40 Amount database.PokerChip 41 Animation bool 42 IsGain bool 43 } 44 45 type PlayerBetEvent struct { 46 PlayerSeatIdx int 47 Player database.Username 48 Bet database.PokerChip 49 TotalBet database.PokerChip 50 Cash database.PokerChip 51 } 52 53 type RefreshLoadingIconEvent struct{} 54 55 type LogEvent struct { 56 Message string 57 } 58 59 type AutoActionEvent struct { 60 Message string 61 } 62 63 type RefreshButtonsEvent struct{} 64 65 type ErrorMsgEvent struct { 66 Message string 67 } 68 69 func NewErrorMsgEvent(msg string) ErrorMsgEvent { 70 return ErrorMsgEvent{Message: msg} 71 } 72 73 type PlayerFoldEvent struct { 74 Card1Idx, Card2Idx int 75 } 76 77 type PokerMinRaiseUpdatedEvent struct { 78 MinRaise database.PokerChip 79 } 80 81 type PokerMainPotUpdatedEvent struct { 82 MainPot database.PokerChip 83 } 84 85 type PokerWaitTurnEvent struct { 86 Idx int 87 CreatedAt time.Time 88 } 89 90 type RedrawSeatsEvent struct{} 91 92 type PokerSeatTakenEvent struct { 93 } 94 95 type PokerSeatLeftEvent struct { 96 } 97 98 type PokerYourTurnEvent struct { 99 }