swarm-0.4: 2D resource gathering game with programmable robots
Safe HaskellSafe-Inferred
LanguageHaskell2010

Swarm.TUI.View.CellDisplay

Description

Rendering of cells in the map view

SPDX-License-Identifier: BSD-3-Clause

Synopsis

Documentation

renderDisplay :: Display -> Widget n Source #

Render a display as a UI widget.

drawLoc :: UIState -> GameState -> Cosmic Coords -> Widget Name Source #

Render the Display for a specific location.

displayLoc :: Bool -> WorldEditor Name -> GameState -> Cosmic Coords -> Display Source #

Get the Display for a specific location, by combining the Displays for the terrain, entity, and robots at the location, and taking into account "static" based on the distance to the robot being viewed.

displayLocRaw :: Bool -> WorldEditor Name -> GameState -> Cosmic Coords -> Display Source #

Get the Display for a specific location, by combining the Displays for the terrain, entity, and robots at the location.

staticDisplay :: GameState -> Coords -> Display Source #

Random "static" based on the distance to the robot being viewed.

displayStatic :: Word32 -> Display Source #

Draw static given a number from 0-15 representing the state of the four quarter-pixels in a cell

staticChar :: Word32 -> Char Source #

Given a value from 0--15, considered as 4 bits, pick the character with the corresponding quarter pixels turned on.

getStatic :: GameState -> Coords -> Maybe Word32 Source #

Random "static" based on the distance to the robot being viewed. A cell can either be static-free (represented by Nothing) or can have one of sixteen values (representing the state of the four quarter-pixels in one cell).