Pénalité lorsqu'on échoue un défi

This commit is contained in:
2024-12-13 00:02:58 +01:00
parent 63ad84eb8c
commit 4cb2677f45
6 changed files with 34 additions and 9 deletions

View File

@ -1,5 +1,5 @@
import { useAppDispatch, useAppSelector } from "./useStore"
import { GamePayload, setPlayerId, updateActiveChallengeId, updateGameState, updateMoney } from "@/utils/features/game/gameSlice"
import { GamePayload, PenaltyPayload, setPlayerId, updateActiveChallengeId, updateGameState, updateMoney, updatePenalty } from "@/utils/features/game/gameSlice"
export const useGame = () => useAppSelector((state) => state.game)
export const useSetPlayerId = () => {
@ -18,3 +18,7 @@ export const useUpdateGameState = () => {
const dispatch = useAppDispatch()
return (game: GamePayload) => dispatch(updateGameState(game))
}
export const useUpdatePenalty = () => {
const dispatch = useAppDispatch()
return (penalty: PenaltyPayload) => dispatch(updatePenalty(penalty))
}