-
Notifications
You must be signed in to change notification settings - Fork 1
/
status.h
57 lines (51 loc) · 1.42 KB
/
status.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef _STATUS_
#define _STATUS_
#include <exception>
#include <algorithm>
#include <vector>
#include "Player.h"
#define noexcept throw ()
#define BLANK_BLOCK {}
using std::vector;
using std::exception;
class PlayerNotFoundException : public exception
{
private:
char* exceptionMessageString;
public:
PlayerNotFoundException(const char* exceptionMessage) {
strcpy(this->exceptionMessageString, exceptionMessage);
}
virtual const char* what() const noexcept {
return exceptionMessageString;
}
};
class Status
{
private:
bool foulStatus;
bool turnProgressStatus;
bool turnChangeStatus;
vector<Player*> playerList;
Player* pNowPlayer;
int currentTurnCount;
int winnerPlayer;
public:
Status(vector<Player*> playerList);
Player* getTurnPlayer() noexcept;
Player* getNotTurnPlayer() noexcept;
vector<int> getPlayerIdList() const noexcept;
bool getFoulStatus() const noexcept;
bool getTurnProgressStatus() const noexcept;
bool getTurnChangeStatus() const noexcept;
bool getGameEndStatus() const noexcept;
int getCurrentTurnCount() const noexcept;
int getWinnerPlayer() const;
void setWinnerPlayer(int winner) noexcept;
void setFoulStatus(bool toSet) noexcept;
void setTurnProgressStatus(bool toSet) noexcept;
void setTurnChangeStatus(bool toSet) noexcept;
void setTurnPlayer(int playerID) throw (PlayerNotFoundException);
void nextTurnCount() noexcept;
};
#endif