-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCCell.h
38 lines (27 loc) · 866 Bytes
/
CCell.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef _CCELL_H_
#define _CCELL_H_
#include "includer.h"
class CCell
{
private:
bool alive;
uint16_t row;
uint16_t col;
public:
enum CCellState {
CCELL_TYPE_DEAD = 0,
CCELL_TYPE_ALIVE,
CCELL_TYPE_REPROD,
CCELL_TYPE_DYING
};
private:
CCell();
public:
CCell( uint16_t row, uint16_t col, bool alive ) : alive( alive ), row( row ), col( col ) {}
bool isAlive () { return alive; }
void setAlive ( bool alive ) { this->alive = alive; }
uint16_t getRow () { return row; }
uint16_t getCol () { return col; }
friend std::ostream& operator<< ( std::ostream& out, const CCell& cell ) { return out << "[" << cell.row << "," << cell.col << "]: " << cell.alive; }
}; //CCell
#endif // _CCELL_H_