summaryrefslogtreecommitdiff
path: root/src/cell.cc
blob: c586a730d2865e81b4f44ae33b0b021365eeca39 (plain)
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
39

#include "cell.h"

Cell::Cell()
{
	cell_value = 0;
	cell_valid = true;
}

Cell::Cell(const Cell & other)
{
	assign(other);
}
	
void Cell::assign(const Cell & other)
{
	cell_valid = other.cell_valid;
	cell_value = other.cell_value;
	cell_valid = other.cell_valid;
	
	for (int i = 0; i < 9; i++) {
		cell_possibility[i] = other.cell_possibility[i];
	}
}
	
void Cell::set_value(int value)
{
	cell_value = value;
}

void Cell::set_possibility(int value, bool possible)
{
	cell_possibility[value] = possible;
}

void Cell::set_valid(bool valid)
{
	cell_valid = valid;
}