Skip to content

Commit

Permalink
feat: added game repo code
Browse files Browse the repository at this point in the history
  • Loading branch information
djpiper28 committed Aug 29, 2024
1 parent b9571a2 commit 922949a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions backend/gameRepo/game_repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,3 +311,15 @@ func (gr *GameRepo) EndOldGames() []uuid.UUID {
}
return endedGames
}

func (gr *GameRepo) CzarSelectsCard(gameId, pid uuid.UUID, cards []int) (gameLogic.CzarSelectCardResult, error) {
gr.lock.RLock()
defer gr.lock.RUnlock()

game, found := gr.GameMap[gameId]
if !found {
return gameLogic.CzarSelectCardResult{}, errors.New("Cannot find game")
}

return game.CzarSelectCards(pid, cards)
}

0 comments on commit 922949a

Please sign in to comment.