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

Language | Haskell2010 |

Operations for starting and restarting the game.

- initPer :: MonadServer m => m ()
- reinitGame :: MonadServerAtomic m => m ()
- gameReset :: MonadServer m => ServerOptions -> Maybe (GroupName ModeKind) -> Maybe StdGen -> m State
- applyDebug :: MonadServer m => m ()
- mapFromFuns :: (Bounded a, Enum a, Ord b) => [a -> b] -> Map b a
- resetFactions :: FactionDict -> Id 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

resetFactions :: FactionDict -> Id 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.