From f2e1f97490f3f982dc7c5288531254dd5afc4a8d Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Mon, 3 Aug 2020 16:24:50 +0200 Subject: Remove cards after submission --- server/lib/Cafp/Game.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/lib/Cafp/Game.hs b/server/lib/Cafp/Game.hs index f0d4d47..8b675e1 100644 --- a/server/lib/Cafp/Game.hs +++ b/server/lib/Cafp/Game.hs @@ -23,7 +23,7 @@ import Cafp.Messages import Control.Lens (Lens', at, iall, imap, ix, orOf, over, to, (%%=), (%=), (&), (+=), (.=), (.~), (^.), (^..), (^?), - _1, _2, _3) + _1, _2, _3, (%~)) import Control.Lens.TH (makeLenses, makePrisms) import Control.Monad (guard) import Control.Monad.State (State, execState, modify, @@ -184,8 +184,12 @@ stepGame game = case game ^. gameTable of pure (proposal, [pid]) (shuffled, seed) = shuffle (V.fromList $ HMS.toList proposalsMap) (game ^. gameSeed) in - game & gameSeed .~ seed + game + & gameSeed .~ seed & gameTable .~ TableVoting black shuffled HMS.empty + & gamePlayers %~ imap (\pid player -> + let used = fromMaybe V.empty $ HMS.lookup pid proposals in + player & playerHand %~ V.filter (not . (`V.elem` used))) | otherwise -> game TableVoting black shuffled votes -- Everyone has voted. -- cgit v1.2.3