Summary Files Commits Branches @commit @diff @stats
path: root / Year 1 / Object-oriented Programming / 07-Practice-05.04.2022 / Game.h
blob: 3b3bb0b0b6ab345f2da888edbdda0b0a28c05f06 (plain) (blame)
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
#ifndef GAME_HEADER
#define GAME_HEADER

#include <iostream>
#include <stdlib.h> // srand, time and rand
#include "Player.h"
#include "GameCase.h"

double getRandomBetween(int, int);

enum TurnResult {
	Quit,
	Continue,
	Win,
	Lost
};

class Game {
	GameCase* cases;
	unsigned caseCount;

	void copyFrom(const Game&);
	void free();

	TurnResult turn(double&) const;
public:
	Game(const GameCase*, unsigned);

	Game(const Game&);
	Game& operator=(const Game&);
	~Game();

	void play(Player&) const;
};

#endif