Safe Haskell | None |
---|---|

Language | Haskell2010 |

Operations for starting and restarting the game.

## Synopsis

- initPer :: MonadServer m => m ()
- reinitGame :: MonadServerAtomic m => m ()
- gameReset :: MonadServer m => ServerOptions -> Maybe (GroupName ModeKind) -> Maybe StdGen -> m State
- applyDebug :: MonadServer m => m ()
- sampleTrunks :: MonadServerAtomic m => Dungeon -> m GenerationAnalytics
- sampleItems :: MonadServerAtomic m => Dungeon -> m GenerationAnalytics
- mapFromFuns :: Ord b => [a] -> [a -> b] -> Map b a
- resetFactions :: FactionDict -> ContentId ModeKind -> Int -> AbsDepth -> Roster -> Rnd FactionDict
- populateDungeon :: MonadServerAtomic m => m ()
- findEntryPoss :: COps -> LevelId -> Level -> Int -> Rnd [Point]

# Documentation

initPer :: MonadServer m => m () Source #

reinitGame :: MonadServerAtomic m => m () Source #

gameReset :: MonadServer m => ServerOptions -> Maybe (GroupName ModeKind) -> Maybe StdGen -> m State Source #

applyDebug :: MonadServer m => m () Source #

Apply options that don't need a new game.

# Internal operations

sampleTrunks :: MonadServerAtomic m => Dungeon -> m GenerationAnalytics Source #

sampleItems :: MonadServerAtomic m => Dungeon -> m GenerationAnalytics Source #

mapFromFuns :: Ord b => [a] -> [a -> b] -> Map b a Source #

resetFactions :: FactionDict -> ContentId ModeKind -> Int -> AbsDepth -> Roster -> Rnd FactionDict Source #

populateDungeon :: MonadServerAtomic m => m () Source #

findEntryPoss :: COps -> LevelId -> Level -> Int -> Rnd [Point] Source #

Find starting postions for all factions. Try to make them distant from each other. Place as many of the factions, as possible, over stairs, starting from the end of the list, including placing the last factions over escapes (we assume they are guardians of the escapes). This implies the inital factions (if any) start far from escapes.