-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame.h
92 lines (58 loc) · 1.71 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#pragma once
#include <iostream>
#include <string>
#include <vector>
#include <memory>
enum Genre {
action, adventure, action_adventure, RPG, simulation,
strategy, sports, MMO, sandbox, casual, horror,
logic, party, typing, photography, idle
};
class Game {
const int id;
const Genre genre;
const std::string title;
std::vector<int> ratings;
std::string publisher;
public:
Game(int n_id, Genre n_genre, std::string n_title);
Genre getGenre();
std::string getTitle() const;
float getAvgRating();
std::string getPublisher() const;
int addRating(int rating);
std::string display();
void setPublisher(std::string newPublisher);
};
std::ostream &operator<<(std::ostream &output, Game &game);
class ReviewRequest {
int id;
std::shared_ptr<Game> game;
int hoursTested = 0;
int submissionHour = 0;
int hourPaid = 0;
bool paid = false;
int hoursRequested;
int price = 0;
int rate = 0;
public:
ReviewRequest(int n_id, std::shared_ptr<Game> n_game, int n_hoursRequested);
std::shared_ptr<Game> getGame() const;
int getId() const;
int getRate() const;
int getHoursRequested() const;
int getHoursTested() const;
unsigned int getHoursLeft() const;
int getPrice() const; // get price
int getSubmissionHour() const;
int getHourPaid() const;
void setPrice(int n_price);
void setRate(int n_rate);
void setSubmissionHour(int newHour);
void addOverhang(int overhang);
bool isPaid() const;
void pay(int hour); // mark this request as paid
int test(int hours);
std::string display() const;
};
std::ostream &operator<<(std::ostream &output, ReviewRequest &review);