Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- initAppState :: AppOpts -> ExceptT Text IO AppState
- startGame :: (MonadIO m, MonadState AppState m) => ScenarioInfoPair -> Maybe CodeToRun -> m ()
- restartGame :: (MonadIO m, MonadState AppState m) => Seed -> ScenarioInfoPair -> m ()
- attainAchievement :: (MonadIO m, MonadState AppState m) => CategorizedAchievement -> m ()
- attainAchievement' :: (MonadIO m, MonadState AppState m) => ZonedTime -> Maybe FilePath -> CategorizedAchievement -> m ()
- scenarioToAppState :: (MonadIO m, MonadState AppState m) => ScenarioInfoPair -> Maybe Seed -> Maybe CodeToRun -> m ()
Documentation
startGame :: (MonadIO m, MonadState AppState m) => ScenarioInfoPair -> Maybe CodeToRun -> m () Source #
Load a Scenario
and start playing the game.
restartGame :: (MonadIO m, MonadState AppState m) => Seed -> ScenarioInfoPair -> m () Source #
Re-initialize the game from the stored reference to the current scenario.
Note that "restarting" is intended only for "scenarios"; with some scenarios, it may be possible to get stuck so that it is either impossible or very annoying to win, so being offered an option to restart is more user-friendly.
Since scenarios are stored as a Maybe in the UI state, we handle the Nothing case upstream so that the Scenario passed to this function definitely exists.
attainAchievement :: (MonadIO m, MonadState AppState m) => CategorizedAchievement -> m () Source #
attainAchievement' :: (MonadIO m, MonadState AppState m) => ZonedTime -> Maybe FilePath -> CategorizedAchievement -> m () Source #
scenarioToAppState :: (MonadIO m, MonadState AppState m) => ScenarioInfoPair -> Maybe Seed -> Maybe CodeToRun -> m () Source #
Modify the AppState
appropriately when starting a new scenario.