haverer-0.1.0.0: Implementation of the rules of Love Letter

Safe HaskellNone
LanguageHaskell2010

Haverer.Game

Synopsis

Documentation

data Game playerId Source

Instances

Show playerId => Show (Game playerId) Source 

data Outcome playerId Source

Instances

Show playerId => Show (Outcome playerId) Source 

finalScores :: Ord playerId => Outcome playerId -> [(playerId, Int)] Source

Get the final scores at the end of the game.

makeGame :: Ord playerId => PlayerSet playerId -> Game playerId Source

Create a new game for the given set of players.

newRound :: (Functor m, MonadRandom m, Ord playerId, Show playerId) => Game playerId -> m (Round playerId) Source

Start a new round of the game, shuffling the deck cards ourselves.

newRound' :: (Ord playerId, Show playerId) => Game playerId -> Deck Complete -> Round playerId Source

Start a new round of the game with an already-shuffled deck of cards.

players :: Game playerId -> PlayerSet playerId Source

Return the set of all players

playersWon :: Ord playerId => Game playerId -> [playerId] -> Either (Outcome playerId) (Game playerId) Source

Indicate that the specified players won.

roundsPlayed :: Game playerId -> Int Source

Return the number of rounds played.

scores :: Ord playerId => Game playerId -> [(playerId, Int)] Source

Return the current scores of all the players.

winners :: Ord playerId => Outcome playerId -> [playerId] Source

Get the winners of the game.