-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOurException.h
33 lines (29 loc) · 1.06 KB
/
OurException.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
/**
*hidden file of classes IllegalCharException and IllegalCoordinateException
*Authors Alexey Titov and Shir Bentabou
*Version 1.0
**/
//library
#include <exception>
using namespace std;
//Class to handle illegal char insertions. Using function 'setCh' by the Board Class '=' operator function.
class IllegalCharException:public exception{
private:
char ch;
public:
//Function for exception throwing, returns the value in ch.
char theChar() const;
//Function for setting value in ch.
void setCh(const char& c);
};
//Class to handle illegal insertions by coordinates. Using constructor by the Board Class '=' operator function.
class IllegalCoordinateException:public exception{
private:
int row;
int col;
public:
//Constructor for IllegalCoordinateException class.
IllegalCoordinateException(const int& r,const int& c);
//Function for exception throwing - returns the string printed in the exception throwing.
string theCoordinate() const;
};