commit 9b92fe0eb84b2bc0438ceff11173cc19b7af0725
parent 924f4a847a48f2f05f70b606f574684cdfc9afca
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Sun, 17 Dec 2023 06:04:31 -0500
move code
Diffstat:
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/pkg/web/handlers/poker/poker.go b/pkg/web/handlers/poker/poker.go
@@ -205,18 +205,6 @@ func (g *Ongoing) setMainPot(v database.PokerChip) {
g.mainPot.Store(uint64(v))
}
-// Get the player index in Ongoing.Players from a seat index (index in PokerGame.Players)
-// [nil p1 nil nil p2 nil] -> PokerGame.Players
-// [p1 p2] -> Ongoing.Players
-func (g *Ongoing) getPlayerIdxBySeatIdx(seatIdx int) (idx int) {
- for i, p := range g.Players {
- if p.SeatIdx == seatIdx {
- return i
- }
- }
- return -1
-}
-
func (g *Ongoing) computeWinners() (winner []GameResult) {
countAlive := 0
var lastAlive *PokerPlayer
@@ -312,6 +300,18 @@ func (g *Ongoing) GetPlayerBySeatIdx(seatIdx int) *PokerPlayer {
return nil
}
+// Get the player index in Ongoing.Players from a seat index (index in PokerGame.Players)
+// [nil p1 nil nil p2 nil] -> PokerGame.Players
+// [p1 p2] -> Ongoing.Players
+func (g *Ongoing) getPlayerIdxBySeatIdx(seatIdx int) (idx int) {
+ for i, p := range g.Players {
+ if p.SeatIdx == seatIdx {
+ return i
+ }
+ }
+ return -1
+}
+
func (g *Ongoing) CountCanVotePlayers() (nbCanVote int) {
for _, p := range g.Players {
if !p.Folded.Load() && !p.isAllIn() {