Copyright | (c) Henry J. Wylde, 2015 |
---|---|
License | BSD3 |
Maintainer | public@hjwylde.com |
Safe Haskell | None |
Language | Haskell2010 |
Engine functions.
- checkTurn :: (MonadState Game m, MonadWriter [Message] m) => m ()
- checkGameOver :: (MonadState Game m, MonadWriter [Message] m) => m ()
- startGame :: (MonadError [Message] m, MonadWriter [Message] m) => Text -> [Player] -> m Game
- killPlayer :: MonadState Game m => Player -> m ()
- isSeersTurn :: MonadState Game m => m Bool
- isVillagersTurn :: MonadState Game m => m Bool
- isWerewolvesTurn :: MonadState Game m => m Bool
- isGameOver :: MonadState Game m => m Bool
- getPlayerSee :: MonadState Game m => Text -> m (Maybe Text)
- getPlayerVote :: MonadState Game m => Text -> m (Maybe Text)
- defaultFilePath :: MonadIO m => m FilePath
- writeGame :: MonadIO m => Game -> m ()
- readGame :: MonadIO m => m Game
- deleteGame :: MonadIO m => m ()
- doesGameExist :: MonadIO m => m Bool
- createPlayers :: MonadIO m => [Text] -> [Role] -> m [Player]
- doesPlayerExist :: MonadState Game m => Text -> m Bool
- isPlayerSeer :: MonadState Game m => Text -> m Bool
- isPlayerVillager :: MonadState Game m => Text -> m Bool
- isPlayerWerewolf :: MonadState Game m => Text -> m Bool
- isPlayerAlive :: MonadState Game m => Text -> m Bool
- isPlayerDead :: MonadState Game m => Text -> m Bool
- randomiseRoles :: MonadIO m => [Role] -> Int -> m [Role]
Loop
checkTurn :: (MonadState Game m, MonadWriter [Message] m) => m () Source
checkGameOver :: (MonadState Game m, MonadWriter [Message] m) => m () Source
Game
Manipulations
startGame :: (MonadError [Message] m, MonadWriter [Message] m) => Text -> [Player] -> m Game Source
killPlayer :: MonadState Game m => Player -> m () Source
Queries
isSeersTurn :: MonadState Game m => m Bool Source
isVillagersTurn :: MonadState Game m => m Bool Source
isWerewolvesTurn :: MonadState Game m => m Bool Source
isGameOver :: MonadState Game m => m Bool Source
getPlayerSee :: MonadState Game m => Text -> m (Maybe Text) Source
getPlayerVote :: MonadState Game m => Text -> m (Maybe Text) Source
Reading and writing
defaultFilePath :: MonadIO m => m FilePath Source
deleteGame :: MonadIO m => m () Source
doesGameExist :: MonadIO m => m Bool Source
Player
Manipulations
Queries
doesPlayerExist :: MonadState Game m => Text -> m Bool Source
isPlayerSeer :: MonadState Game m => Text -> m Bool Source
isPlayerVillager :: MonadState Game m => Text -> m Bool Source
isPlayerWerewolf :: MonadState Game m => Text -> m Bool Source
isPlayerAlive :: MonadState Game m => Text -> m Bool Source
isPlayerDead :: MonadState Game m => Text -> m Bool Source