GameOfLifeEffect
Source:
GameOfLifeEffect.h
GameOfLifeEffect¶
src/light/effects/GameOfLifeEffect.h:25Inherits:
EffectBase
Conway's Game of Life cellular-automaton effect.
Public Attributes¶
uint8_t backgroundColorR = 0
uint8_t backgroundColorG = 0
uint8_t backgroundColorB = 0
uint8_t ruleset = 1
char customRuleString = "B/
uint8_t speed = 20
uint8_t lifeChance = 32
uint8_t mutation = 2
bool wrap =
bool disablePause =
bool colorByAge =
bool infinite =
uint8_t blur = 128
Public Methods¶
virtual inline constchar * tags() const override
: Curated emoji tags for the module picker's chip filter — extras beyond the role chip (which the UI derives from role() on its own).
virtual inline void defineControls() override
: defineControls MUST be idempotent and pure: only controls_.clear() + controls_.addX().
virtual inline void prepare() override
: Tier-3 of the control-change split (see onControlChanged above): the module (re)allocates / recomputes whatever derived state it owns — an effect's heap, a Layer's mapping LUT, the Drivers output buffer.
virtual inline void onControlChanged(constchar *) override
: Cheap per-control reaction, tier 1 of the three-tier control-change split (mirrors MoonLight's onUpdate / requestMappings / onSizeChanged; see architecture.md § Rebuild propagation).
inline bool allocateForTest(lengthType w, lengthType h, lengthType d)
inline void setCellForTest(lengthType x, lengthType y, lengthType z, bool on)
inline bool isAliveForTest(lengthType x, lengthType y, lengthType z) const
inline void stepForTest()
inline void parseRulesetForTest()
inline bool birthForTest(uint8_t n) const
inline bool surviveForTest(uint8_t n) const
virtual inline void tick() override
Public Static Attributes¶
constexprconstchar * kRulesetOptions = {
"Custom /,
"Conway' /,
"HighLife /,
"InverseLife /,
"Maze /,
"Mazecentric /,
"DrighLife /}
constexpruint8_t kRulesetCount = 7
constexprconstchar * kRulesetStrings = {
,
"B3/,
"B36/,
"B0123478/,
"B3/,
"B3/,
"B367/}