-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCell.h
42 lines (32 loc) · 1014 Bytes
/
Cell.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
39
40
41
42
/**
*hidden file of class Cell
*Authors Alexey Titov and Shir Bentabou
*Version 1.0
**/
//library
#include <iostream>
using namespace std;
class Cell{
private:
char value;
public:
//Empty constructor.
Cell();
//Function that sets value in Cell object.
void setValue(const char& c);
//Function that gets value from Cell object.
const char getValue();
//Operator '=' overloading for Cell class. If the char given is not 'X' or 'O' - an exception is thrown.
Cell& operator=(char c);
//operator casting from Cell to char
operator char() const;
//----------------------------------
// friend global IO operators
//----------------------------------
friend ostream& operator<< (ostream& os, Cell& c);
};
//----------------------------------------
// friend global IO operators
//----------------------------------------
//Operator '<<' overloading for Cell class.
ostream& operator<< (ostream& os, Cell& c);