CellViz  1.0
Public Member Functions | Private Attributes | List of all members
DiscreteAutomaton Class Referenceabstract

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

#include <cells.h>

Inheritance diagram for DiscreteAutomaton:
CellularAutomaton BasicLife SmithLife

Public Member Functions

 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...
 
virtual double get_value ()=0
 
virtual int get_x ()=0
 
virtual int get_y ()=0
 
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
 

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 DiscreteAutomaton.

Constructor & Destructor Documentation

◆ DiscreteAutomaton() [1/3]

DiscreteAutomaton::DiscreteAutomaton ( )

Default constructor for DiscreteAutomaton.

◆ DiscreteAutomaton() [2/3]

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

Parameterized constructor for DiscreteAutomaton.

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

◆ DiscreteAutomaton() [3/3]

DiscreteAutomaton::DiscreteAutomaton ( const DiscreteAutomaton cell)

Copy constructor for DiscreteAutomaton.

Parameters
cellThe DiscreteAutomaton object to copy.

Member Function Documentation

◆ get_value()

virtual double DiscreteAutomaton::get_value ( )
pure virtual

Implemented in SmithLife, and BasicLife.

◆ get_x()

virtual int DiscreteAutomaton::get_x ( )
pure virtual

Implemented in SmithLife, and BasicLife.

◆ get_y()

virtual int DiscreteAutomaton::get_y ( )
pure virtual

Implemented in SmithLife, and BasicLife.

◆ operator==()

bool DiscreteAutomaton::operator== ( const DiscreteAutomaton cell) const

Equality operator for DiscreteAutomaton.

Parameters
cellThe DiscreteAutomaton to compare.
Returns
true if both cells are equal, false otherwise.

◆ set_value()

void DiscreteAutomaton::set_value ( double  value)

Sets the value of the DiscreteAutomaton.

Parameters
valueThe new value.

◆ set_x()

void DiscreteAutomaton::set_x ( int  x)

Sets the x-coordinate of the DiscreteAutomaton.

Parameters
xThe new x-coordinate.

◆ set_y()

void DiscreteAutomaton::set_y ( int  y)

Sets the y-coordinate of the DiscreteAutomaton.

Parameters
yThe new y-coordinate.

Member Data Documentation

◆ value

double DiscreteAutomaton::value
private

◆ x

int DiscreteAutomaton::x
private

◆ y

int DiscreteAutomaton::y
private

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