-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathGame.cpp
More file actions
52 lines (40 loc) · 955 Bytes
/
Copy pathGame.cpp
File metadata and controls
52 lines (40 loc) · 955 Bytes
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
//
// Created by josh on 4/29/23.
//
#include "Game.h"
Game::Game(string playerPhonenum, string judgePhonenum) {
this->playerPhonenum = playerPhonenum;
this->judgePhonenum = judgePhonenum;
string aiLetter = rand() % 2 == 0 ? "A" : "B";
this->aiLetter = aiLetter;
}
bool Game::isJudge(string phonenum) {
return judgePhonenum == phonenum;
}
bool Game::isAI(string letter) {
return aiLetter == letter;
}
string Game::getPlayerPhonenum() {
return playerPhonenum;
}
string Game::getJudgePhonenum() {
return judgePhonenum;
}
int Game::getNoOfMessages() {
return no_of_messages;
}
void Game::incrementNoOfMessages() {
no_of_messages++;
}
bool Game::isGameOver() {
return game_over;
}
void Game::setGameOver(bool game_over) {
this->game_over = game_over;
}
void Game::addAIMessage(string message) {
AI_messages.push_back(message);
}
vector <string> Game::getAIMessages() {
return AI_messages;
}