-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
31 lines (26 loc) · 844 Bytes
/
main.cpp
File metadata and controls
31 lines (26 loc) · 844 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
#define MAIN
#include "rules.h"
void runGame() {
int sideCounter = 0, nPlayers = 0;
Game game(sideCounter, nPlayers);
Rules rules(nPlayers);
while (!rules.gameOver(game)) {
sideCounter = nPlayers - 1;
while (!rules.roundOver(game)) {
Player ¤tPlayer = game.getPlayer(sides[(sideCounter = (sideCounter + 1) % nPlayers)]);
cout << "Round: " << game.getRound() << " , Turn: " << currentPlayer.getName() << endl;
if (currentPlayer.isActive()) { game.setCurrentCard(game.getCard(Z, Zero)); }
if (!rules.isValid(game)) currentPlayer.setActive(false);
game.setCurrentCard(nullptr);
cout << game << endl;
}
game.nextRound();
}
cout << game << endl;
}
#ifdef MAIN
int main() {
runGame();
return 0;
}
#endif