Godot Nature of Code
1.2.0
Nature of Code implemented in Godot Engine
|
Cellular automata 2D. More...
Inherits Node2D.
Public Member Functions | |
CellularAutomata2D () | |
Create a default cellular automata with a cell scale of 20. More... | |
CellularAutomata2D (int scale) | |
Create a default cellular automata with a custom cell scale. More... | |
virtual void | RandomizeGrid () |
Randomize grid. More... | |
Protected Member Functions | |
virtual Vector2 | GetAutomataBounds () |
Get automata bounds. More... | |
virtual void | InitializeGrid () |
Initialize grid. More... | |
virtual void | InitializeCell (TCell cell, int i, int j) |
Initialize cell. More... | |
virtual void | ReviveCellAtScreenPos (Vector2 pos) |
Revive cell at screen position. More... | |
virtual int | GetAliveNeighborsFromCell (int x, int y) |
Get alive neighbors from cell position. More... | |
virtual T | ApplyRules (int x, int y) |
Apply rules on cell and return next state. More... | |
virtual void | Generate () |
Create a new generation. More... | |
Protected Attributes | |
TCell[] | _grid |
Grid nodes More... | |
int | _scale |
Cell scale More... | |
int | _rows |
Row count More... | |
int | _cols |
Cols count More... | |
int | _generation |
Current generation More... | |
Node2D | _gridContainer |
Grid container More... | |
Properties | |
float | WaitTime [get, set] |
Wait time More... | |
Color | CellColor = Colors.LightBlue [get, set] |
Cell color More... | |
bool | Paused [get, set] |
Paused More... | |
bool | HighlightTransitions [get, set] |
Highlight when a cell is transitioning from life to death More... | |
bool | CenterAlignedGrid [get, set] |
Align grid to the center More... | |
bool | HideGUI [get, set] |
Hide GUI More... | |
TouchBehaviorEnum | TouchBehavior [get, set] |
Touch behavior More... | |
WrapBehaviorEnum | WrapBehavior [get, set] |
Wrap behavior More... | |
Cellular automata 2D.
TCell | : | Cell<T> | |
TCell | : | new() | |
T | : | System.IEquatable<T> |
Definition at line 160 of file CellularAutomata2D.cs.
|
inline |
Create a default cellular automata with a cell scale of 20.
Definition at line 235 of file CellularAutomata2D.cs.
|
inline |
Create a default cellular automata with a custom cell scale.
scale | Scale |
Definition at line 241 of file CellularAutomata2D.cs.
|
inlineprotectedvirtual |
Apply rules on cell and return next state.
x | X position |
y | Y position |
Definition at line 464 of file CellularAutomata2D.cs.
|
inlineprotectedvirtual |
Create a new generation.
Definition at line 488 of file CellularAutomata2D.cs.
|
inlineprotectedvirtual |
Get alive neighbors from cell position.
x | X position |
y | Y position |
Definition at line 441 of file CellularAutomata2D.cs.
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
Initialize cell.
cell | Cell |
i | X position |
j | Y position |
Definition at line 404 of file CellularAutomata2D.cs.
|
inlineprotectedvirtual |
Initialize grid.
Definition at line 372 of file CellularAutomata2D.cs.
|
inlinevirtual |
Randomize grid.
Definition at line 254 of file CellularAutomata2D.cs.
|
inlineprotectedvirtual |
Revive cell at screen position.
pos | Screen position |
Definition at line 413 of file CellularAutomata2D.cs.
|
protected |
Cols count
Definition at line 217 of file CellularAutomata2D.cs.
|
protected |
Current generation
Definition at line 220 of file CellularAutomata2D.cs.
|
protected |
Grid nodes
Definition at line 208 of file CellularAutomata2D.cs.
|
protected |
Grid container
Definition at line 223 of file CellularAutomata2D.cs.
|
protected |
Row count
Definition at line 214 of file CellularAutomata2D.cs.
|
protected |
Cell scale
Definition at line 211 of file CellularAutomata2D.cs.
|
getset |
Cell color
Definition at line 179 of file CellularAutomata2D.cs.
|
getset |
|
getset |
Hide GUI
Definition at line 191 of file CellularAutomata2D.cs.
|
getset |
Highlight when a cell is transitioning from life to death
Definition at line 185 of file CellularAutomata2D.cs.
|
getset |
|
getset |
|
getset |
Wait time
Definition at line 165 of file CellularAutomata2D.cs.
|
getset |