|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Default binary text palette. More...
#include <ca-ascii.H>
Public Member Functions | |
| std::string | operator() (const State &value) const |
| Map a cell state to display text. | |
| std::size_t | glyph_width () const noexcept |
| Visible width of a single rendered cell, in columns. | |
Public Attributes | |
| State | dead {} |
| state considered dead | |
| std::string | dead_glyph = "." |
| glyph for dead cells | |
| std::string | alive_glyph = "#" |
| glyph for live cells | |
Default binary text palette.
Cells equal to dead use dead_glyph; all other states use alive_glyph.
| State | cell state type. |
Definition at line 81 of file ca-ascii.H.
|
inlinenoexcept |
Visible width of a single rendered cell, in columns.
Used by render_ascii to size the optional +---+ border so it aligns with the glyphs. Returns max(dead_glyph.size(), alive_glyph.size()).
Definition at line 103 of file ca-ascii.H.
References Aleph::CA::Binary_ASCII_Palette< State >::alive_glyph, and Aleph::CA::Binary_ASCII_Palette< State >::dead_glyph.
|
inline |
Map a cell state to display text.
| [in] | value | cell value. |
Definition at line 91 of file ca-ascii.H.
References Aleph::CA::Binary_ASCII_Palette< State >::alive_glyph, Aleph::CA::Binary_ASCII_Palette< State >::dead, Aleph::CA::Binary_ASCII_Palette< State >::dead_glyph, and value.
| std::string Aleph::CA::Binary_ASCII_Palette< State >::alive_glyph = "#" |
glyph for live cells
Definition at line 85 of file ca-ascii.H.
Referenced by Aleph::CA::Binary_ASCII_Palette< State >::glyph_width(), and Aleph::CA::Binary_ASCII_Palette< State >::operator()().
| State Aleph::CA::Binary_ASCII_Palette< State >::dead {} |
state considered dead
Definition at line 83 of file ca-ascii.H.
Referenced by Aleph::CA::Binary_ASCII_Palette< State >::operator()().
| std::string Aleph::CA::Binary_ASCII_Palette< State >::dead_glyph = "." |
glyph for dead cells
Definition at line 84 of file ca-ascii.H.
Referenced by Aleph::CA::Binary_ASCII_Palette< State >::glyph_width(), and Aleph::CA::Binary_ASCII_Palette< State >::operator()().