-
Notifications
You must be signed in to change notification settings - Fork 0
/
Base.hpp
40 lines (32 loc) · 813 Bytes
/
Base.hpp
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
// Buğra Ekuklu, 150120016
#ifndef BaseDeclaration
#define BaseDeclaration
enum class GameResult : unsigned int {
Lose = 0,
Tie = 1,
Win = 2,
};
GameResult reverse(GameResult result) {
switch (result) {
case GameResult::Lose:
return GameResult::Win;
case GameResult::Tie:
return GameResult::Tie;
case GameResult::Win:
return GameResult::Lose;
}
}
class Red;
class DarkRed;
class Blue;
class Green;
class Base {
public:
virtual ~Base() { }
virtual GameResult compare(Base &opponent) = 0;
virtual GameResult compare(Red &opponent) = 0;
virtual GameResult compare(DarkRed &opponent) = 0;
virtual GameResult compare(Blue &opponent) = 0;
virtual GameResult compare(Green &opponent) = 0;
};
#endif