Files
Text-Adventure/Engine/headers/game.h
T

43 lines
785 B
C++
Raw Normal View History

2026-08-07 13:10:07 -05:00
#pragma once
#include <filesystem>
#include <fstream>
#include <string>
#include <vector>
#include "CommandParser.h"
#include "game.h"
#include "json.hpp"
#include "player.h"
#include "room.h"
extern bool isActive;
#define MAP_HEIGHT 5
#define MAP_WIDTH 5
namespace fs = std::filesystem;
class Game {
private:
std::vector<std::vector<Room>> rooms;
Player player;
int progress;
CommandParser parser;
nlohmann::json json;
fs::path filePath = "Resources/Rooms.json";
std::ifstream stream;
public:
Game();
static bool GetIsActive() { return isActive; }
bool Init();
void ChangeRoom(Direction dir);
void Run();
bool Save();
static void SetIsActive(const bool active) { isActive = active; }
};
static int Exit(std::string n);