swarm-0.7.0.0: 2D resource gathering game with programmable robots
LicenseBSD-3-Clause
Safe HaskellNone
LanguageHaskell2010

Swarm.Game.Scenario.Topography.WorldPalette

Description

 
Synopsis

Documentation

type WorldPalette e = StructurePalette (PCell e) Source #

A world palette maps characters to Cell values.

type TerrainWith a = (TerrainType, Erasable a) Source #

getUniqueTerrainFacadePairs :: [CellPaintDisplay] -> Map (TerrainWith EntityName) (TerrainWith EntityFacade) Source #

We want to identify all of the unique (terrain, entity facade) pairs. However, EntityFacade includes a Display record, which contains more fields than desirable for use as a unique key. Therefore, we extract just the entity name for use in a (terrain, entity name) key, and couple it with the original (terrain, entity facade) pair in a Map.

genericCharacterPool :: Set Char Source #

All alphanumeric characters. These are used as supplemental map placeholders in case a pre-existing display character is not available to re-use.

prepForJson :: PaletteAndMaskChar -> Grid (Maybe CellPaintDisplay) -> (String, KeyMap CellPaintDisplay) Source #

Note that display characters are not unique across different entities! However, the palette KeyMap as a conveyance serves to dedupe them.