swarm-0.5.0.0: 2D resource gathering game with programmable robots
LicenseBSD-3-Clause
Safe HaskellSafe-Inferred
LanguageHaskell2010

Swarm.Game.World.Gen

Description

Utilities for working with procedurally generated worlds.

Synopsis

Documentation

type Seed = Int Source #

extractEntities :: TTerm g a -> Set Entity Source #

Extract a list of all entities mentioned in a given world DSL term.

findOffset :: Integer -> ((Coords -> (t, Erasable (Last e))) -> Bool) -> WorldFun t e -> WorldFun t e Source #

Offset a world by a multiple of the skip in such a way that it satisfies the given predicate.

findPatchWith :: [Text] -> WorldFun t Entity -> WorldFun t Entity Source #

Offset the world so the base starts in a 32x32 patch containing at least one of each of a list of required entities.

findTreeOffset :: WorldFun t Entity -> WorldFun t Entity Source #

Offset the world so the base starts on empty spot next to tree and grass.

findGoodOrigin :: WorldFun t Entity -> WorldFun t Entity Source #

Offset the world so the base starts in a good patch (near necessary items), next to a tree.