-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
36 lines (26 loc) · 922 Bytes
/
main.cpp
File metadata and controls
36 lines (26 loc) · 922 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
32
33
34
35
36
#include <iostream>
#include <fstream>
#include "window.h"
int main() {
std::cout << "Starting Minesweeper!" << std::endl;
std::ifstream file("files/config.cfg");
if (!file.is_open()) {
std::cerr << "File Not Found." << std::endl;
return EXIT_FAILURE;
}
std::string tempRows;
std::string tempColumns;
std::string tempMines;
std::getline(file, tempColumns);
std::getline(file, tempRows);
std::getline(file, tempMines);
int NUMBER_ROWS = std::stoi(tempRows);
int NUMBER_COLUMNS = std::stoi(tempColumns);
int NUMBER_MINES = std::stoi(tempMines);
windows::WelcomeScreen welcomeScreen(NUMBER_ROWS, NUMBER_COLUMNS);
if (welcomeScreen.ExecuteWelcomeScreen()) {
windows::GameWindow gameWindow(NUMBER_ROWS, NUMBER_COLUMNS, NUMBER_MINES, welcomeScreen.stringName);
gameWindow.ExecuteGameWindow();
}
return EXIT_SUCCESS;
}