CellViz  1.0
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
SmithLife Class Reference

Represents a type of cellular automaton called SmithLife. More...

#include <cells.h>

Inheritance diagram for SmithLife:
DiscreteAutomaton CellularAutomaton

Public Member Functions

 SmithLife (int x, int y, double value)
 Parameterized constructor for SmithLife. More...
 
 ~SmithLife ()
 Destructor for SmithLife. More...
 
int get_x ()
 Gets the x-coordinate of the SmithLife cell. More...
 
int get_y ()
 Gets the y-coordinate of the SmithLife cell. More...
 
double get_value ()
 Gets the value of the SmithLife cell. More...
 
void set_value (double value)
 Sets the value of the SmithLife cell. More...
 
- Public Member Functions inherited from DiscreteAutomaton
 DiscreteAutomaton ()
 Default constructor for DiscreteAutomaton. More...
 
 DiscreteAutomaton (int x, int y, double value)
 Parameterized constructor for DiscreteAutomaton. More...
 
 DiscreteAutomaton (const DiscreteAutomaton &cell)
 Copy constructor for DiscreteAutomaton. More...
 
void set_x (int x)
 Sets the x-coordinate of the DiscreteAutomaton. More...
 
void set_y (int y)
 Sets the y-coordinate of the DiscreteAutomaton. More...
 
void set_value (double value)
 Sets the value of the DiscreteAutomaton. More...
 
bool operator== (const DiscreteAutomaton &cell) const
 Equality operator for DiscreteAutomaton. More...
 
- Public Member Functions inherited from CellularAutomaton
virtual ~CellularAutomaton ()=default
 

Static Public Member Functions

static void compute (Board &board)
 Computes the next state of the Board based on SmithLife rules. More...
 

Private Attributes

int x
 
int y
 
double value
 

Additional Inherited Members

- Protected Member Functions inherited from CellularAutomaton
 CellularAutomaton ()=default
 
- Static Protected Member Functions inherited from CellularAutomaton
static void compute (Board *board)
 

Detailed Description

Represents a type of cellular automaton called SmithLife.

Constructor & Destructor Documentation

◆ SmithLife()

SmithLife::SmithLife ( int  x,
int  y,
double  value 
)

Parameterized constructor for SmithLife.

Parameters
xThe x-coordinate of the cell.
yThe y-coordinate of the cell.
valueThe value of the cell.

◆ ~SmithLife()

SmithLife::~SmithLife ( )

Destructor for SmithLife.

Member Function Documentation

◆ compute()

void SmithLife::compute ( Board board)
static

Computes the next state of the Board based on SmithLife rules.

Parameters
boardReference to the Board instance.

◆ get_value()

double SmithLife::get_value ( )
virtual

Gets the value of the SmithLife cell.

Implements DiscreteAutomaton.

◆ get_x()

int SmithLife::get_x ( )
virtual

Gets the x-coordinate of the SmithLife cell.

Implements DiscreteAutomaton.

◆ get_y()

int SmithLife::get_y ( )
virtual

Gets the y-coordinate of the SmithLife cell.

Implements DiscreteAutomaton.

◆ set_value()

void SmithLife::set_value ( double  value)

Sets the value of the SmithLife cell.

Parameters
valueThe new value.

Member Data Documentation

◆ value

double SmithLife::value
private

◆ x

int SmithLife::x
private

◆ y

int SmithLife::y
private

The documentation for this class was generated from the following files: