add ouvert games
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
module Skat.Preperation (
|
||||
Bidder(..), Bid, BD(..), Bidders(..), PrepEnv(..), runPreperation,
|
||||
publishGameResults
|
||||
publishGameResults, bidder
|
||||
) where
|
||||
|
||||
import Control.Monad.IO.Class
|
||||
@@ -78,7 +78,7 @@ toPlayers single (Bidders b1 b2 b3) =
|
||||
(toPlayer b2 $ if single == Hand2 then Single else Team)
|
||||
(toPlayer b3 $ if single == Hand3 then Single else Team)
|
||||
|
||||
runPreperation :: Preperation (Maybe (Hand, SkatEnv))
|
||||
runPreperation :: Preperation (Maybe SkatEnv)
|
||||
runPreperation = do
|
||||
bds <- asks bidders
|
||||
onStart (bidder bds Hand1)
|
||||
@@ -90,9 +90,9 @@ runPreperation = do
|
||||
bid <- askBid (bidder bds finalWinner) finalWinner 0
|
||||
publishBid bid finalWinner finalWinner
|
||||
case bid of
|
||||
Just val -> (Just . (finalWinner,)) <$> initGame finalWinner val
|
||||
Just val -> Just <$> initGame finalWinner val
|
||||
Nothing -> publishNoGame >> return Nothing
|
||||
else (Just . (finalWinner,)) <$> initGame finalWinner finalBid
|
||||
else Just <$> initGame finalWinner finalBid
|
||||
|
||||
runBidding :: Bid -> BD -> BD -> Preperation (Hand, Bid)
|
||||
runBidding startingBid reizer gereizter = do
|
||||
@@ -125,7 +125,7 @@ initGame single bid = do
|
||||
-- publish game start
|
||||
publishGameStart game single
|
||||
-- construct skat env
|
||||
return $ mkSkatEnv ps' Nothing game (toPlayers single bds) Hand1
|
||||
return $ mkSkatEnv ps' Nothing game (toPlayers single bds) Hand1 single
|
||||
|
||||
handleGame :: BD -> Bid -> Bool -> Preperation Game
|
||||
handleGame bd bid noSkat = do
|
||||
|
||||
Reference in New Issue
Block a user