-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgame.cpp
More file actions
52 lines (47 loc) · 1.59 KB
/
game.cpp
File metadata and controls
52 lines (47 loc) · 1.59 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
#include <iostream>
#include "game.h"
#include "map/interactible.h"
#define Msg_Welcome "Welcome to DawnStorm, for the System manual, please go to https://dawnstorm.michal-atlas.co"
#define Cursor " > "
namespace DawnStorm {
Map *Game::world = nullptr;
Player Game::player = Player{{5, 10, 5}, Normal, {}};
Room *Game::currentRoom = nullptr;
void Game::Run() {
world = &Map::seychia;
currentRoom = &Room::DB[world->rooms[0]];
std::cout << Msg_Welcome << std::endl << std::endl;
bool running = true;
while (running) {
std::cout << std::endl << Cursor;
std::string input;
std::getline(std::cin, input);
if (input.find("quit") != std::string::npos) {
running = false;
} else {
Interactable *inter = currentRoom->GetInteractable(input);
if (inter != nullptr) {
inter->Interact(this);
} else {
std::cout << "Unknown Command";
}
}
}
}
void Game::Character_Initialization() {
player.stats = Statistics{5, 10, 5};
player.size = Size::Normal;
/*{// RACE SELECTION
bool success = false;
std::cout << "Choose your race:\n- [0] Human\n - [1] Goblin\n - [2] Isk" << std::endl << std::endl
<< Cursor;
int raceChoice;
while (!success) {
std::cin >> raceChoice;
success = false;
}
}*/
{// STAT ALLOCATION
}
}
}