Fixed parsing Scenery

This commit is contained in:
Timothy O'Barr
2026-09-02 11:24:10 -05:00
parent 668d416256
commit 0e7406db96
4 changed files with 100 additions and 29 deletions
+15 -7
View File
@@ -1,18 +1,20 @@
#include "game.h"
int main(int argc, char *argv[]) {
Game game; // Calls default constructor which Initializes GAME
void EditRooms() {
fs::path path("Resources/rooms.json");
std::vector<std::vector<Room>> rooms = {
std::vector<std::vector<Room>> roomDat = {
{
{
0,
"Test Room 1",
"First Test Room",
{{0, S, false}, {1, E, false}},
{{0, "Rock", "A Grey Rock", {"Rock"}, ObjectType::SCENERY, false, 0}},
{
{0, "Rock", "A Grey Rock", {"Rock"}, ObjectType::SCENERY, false, 0},
},
},
{1,
"Test Room 2",
@@ -33,19 +35,25 @@ int main(int argc, char *argv[]) {
{{5, N, false}, {6, E, false}},
{{3, "Waterfall", "A fine waterfall on a cliff", {"Waterfall"}, ObjectType::SCENERY, false, 3}}}}};
nlohmann::json j(rooms);
nlohmann::json j(roomDat);
std::fstream outFile(absolute(path), std::fstream::in | std::fstream::out | std::fstream::app);
outFile << std::setw(4) << j << std::endl;
outFile.close();
/*if (!game) {
}
int main(int argc, char *argv[]) {
Game game; // Calls default constructor which Initializes GAME
if (!game) {
game.Init();
Game::SetGameInstance(&game);
}
while (game.GetIsActive()) {
game.Run();
}*/
}
return 0;
}