Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Game
- makeGame :: (Player, Player, Maybe (Player, Maybe Player)) -> LetterBag -> Dictionary -> Either ScrabbleError Game
- movesMade :: Game -> [Move]
- gameStatus :: Game -> GameStatus
- board :: Game -> Board
- bag :: Game -> LetterBag
- dictionary :: Game -> Dictionary
- moveNumber :: Game -> Int
- player1 :: Game -> Player
- player2 :: Game -> Player
- optionalPlayers :: Game -> Maybe (Player, Maybe Player)
- currentPlayer :: Game -> Player
- getPlayer :: Game -> Int -> Maybe Player
- playerNumber :: Game -> Int
- data GameStatus
- players :: Game -> [Player]
- passes :: Game -> Int
- numberOfPlayers :: Game -> Int
- history :: Game -> History
- data History = History LetterBag (Seq Move)
Documentation
makeGame :: (Player, Player, Maybe (Player, Maybe Player)) -> LetterBag -> Dictionary -> Either ScrabbleError Game Source #
Starts a new game.
A game has at least 2 players, and 2 optional players (player 3 and 4.) The players should be newly created, as tiles from the letter bag will be distributed to each player.
Takes a letter bag and dictionary, which should be localised to the same language.
Yields a tuple with the first player and the initial game state. Returns a Left
if there are not enough
tiles in the letter bag to distribute to the players.
gameStatus :: Game -> GameStatus Source #
dictionary :: Game -> Dictionary Source #
moveNumber :: Game -> Int Source #
currentPlayer :: Game -> Player Source #
playerNumber :: Game -> Int Source #
data GameStatus Source #
Instances
Eq GameStatus Source # | |
Defined in Wordify.Rules.Game.Internal (==) :: GameStatus -> GameStatus -> Bool # (/=) :: GameStatus -> GameStatus -> Bool # | |
Show GameStatus Source # | |
Defined in Wordify.Rules.Game.Internal showsPrec :: Int -> GameStatus -> ShowS # show :: GameStatus -> String # showList :: [GameStatus] -> ShowS # |
numberOfPlayers :: Game -> Int Source #