-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathGame.h
71 lines (52 loc) · 2.17 KB
/
Game.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#ifndef GAME_H
#define GAME_H
#include <iostream>
#include <vector>
#include "Player.h"
#include "Deck.h"
#include <Windows.h>
const unsigned KEY_ENTER = 13;
const unsigned KEY_LEFT = 75;
const unsigned KEY_RIGHT = 77;
const unsigned positionPlayerLabelX = 5; // text displaying current player number
const unsigned positionPlayerLabelY = 3;
const unsigned positionPlayerHandX = positionPlayerLabelX; // where to start drawing current player's hand
const unsigned positionPlayerHandY = positionPlayerLabelY + 5;
const unsigned positionPlayerMatchX = positionPlayerHandX; // where to start drawing current player's matches
const unsigned positionPlayerMatchY = positionPlayerHandY + 15;
const unsigned positionAcquiredCardX = positionPlayerMatchX + 70; // where to start drawing cards drawn from deck/taken from players
const unsigned positionAcquiredCardY = positionPlayerMatchY;
const unsigned positionTargetPlayerX = positionPlayerMatchX; // where to start drawing "Target player: " prompt
const unsigned positionTargetPlayerY = positionPlayerMatchY + 15;
const unsigned positionGuessRankX = positionTargetPlayerX; // where to start drawing "Guess rank: " prompt
const unsigned positionGuessRankY = positionTargetPlayerY + 1;
const unsigned positionCardsLeftInPlayX = 98;
const unsigned positionCardsLeftInPlayY = positionPlayerLabelY;
const unsigned positionWinnersX = 50;
const unsigned positionWinnersY = 20;
class Game
{
public:
Game( unsigned numOfRealPlayers, unsigned numOfAIPlayers, unsigned numPlayers, bool isAIGame );
void run();
private:
Deck deck;
std::vector< Player > players;
const bool isAIGame;
unsigned guesser;
void dealCards();
std::vector< Player >& getPlayers();
void printPlayerMatchPile(unsigned playerNumber ) const;
//void printPlayerHand( unsigned playerNumber ) const; function not needed
void printGameInfo() const;
void guess( unsigned playerNumber );
void computerGuess( unsigned playerNumber );
void checkForMatches( unsigned targetPlayer, CARD_RANK guessedRank, unsigned playerGuessing );
void winner();
unsigned numPlayers;
unsigned numOfRealPlayers;
unsigned numOfAIPlayers;
const unsigned initialHandSize;
unsigned cardsNotInPlay;
};
#endif