Liquorice-0.0.1: Algorithmic Doom map generation

Copyright© Jonathan Dowland 2020
LicenseGPL-3
Maintainerjon+hackage@dow.land
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell98

Liquorice.Monad

Description

Core Liquorice functions for building maps. These are all under the State Monad, the state which is passed around is the Context being operated on.

Many of these functions are wrapped versions of those in Pure.

Synopsis

Documentation

twice :: StateT Context Identity a -> StateT Context Identity () Source #

Perform the supplied action twice.

triple :: Applicative m => m a -> m () Source #

Perform the supplied action three times.

quad :: Applicative m => m a -> m () Source #

Perform the supplied action four times.

box :: Int -> Int -> Int -> Int -> Int -> StateT Context Identity () Source #

Draw a primitive rectangular box, X and Y in size, and give the resulting sector's properties as f floor height, c ceiling height and l light level.

ibox :: Int -> Int -> Int -> Int -> Int -> State Context () Source #

Draw a primitive rectangular box, similar to box, but as an inner sector parented by the last-drawn Sector.

pushpop :: State Context () -> State Context () Source #

Perform the actions x and then return the pen location to the value it had prior to x.

place :: Int -> Int -> StateT Context Identity b -> StateT Context Identity b Source #

Perform the action `stuff at an offset of (x,y) from the current location move the pen back that relative amount afterwards.

withXoff :: Int -> State Context () -> State Context () Source #

Perform the supplied actions with paletteXoff set to the supplied value, then reset paletteXoff.

runWadL :: State Context a -> Context Source #

Evaluate the supplied State Context to produce a pure Context. In other words, run the supplied Liquorice DSL program and calculate the resulting structure.