-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgame.cpp
More file actions
53 lines (40 loc) · 1.02 KB
/
game.cpp
File metadata and controls
53 lines (40 loc) · 1.02 KB
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
//
// Created by cesar on 4/17/2025.
//
#include "game.h"
game::game(string filePath) {
ifstream file(filePath); // Ensure the correct file path
if (!file.is_open()) {
cerr << "Error: Could not open the file!" << endl;
return;
}
string line;
// Read file line by line
while (getline(file, line)) {
stringstream ss(line);
vector<string> row;
string value;
// Split by comma
while (getline(ss, value, ',')) {
row.push_back(value);
}
this->data.push_back(row);
}
file.close();
for (size_t i = 1; i < min(data.size(), size_t(6)); i++) {
for (const auto &val : data[i]) {
cout << val << " | ";
}
cout << endl;
}
}
vector<string> game::getGenre(string genre) {
}
vector<string> game::getMaturity(string maturity) {
}
vector<string> game::getConsole(string console) {
}
vector<string> game::getMultiplayer(string multiplayer) {
}
vector<string> game::getScore(string score) {
}