shadow-over-bishkek001/src/GameState.h
2026-07-17 21:27:47 +03:00

79 lines
1.9 KiB
C++

#pragma once
#include "items/Item.h"
#include "quest/QuestJournal.h"
#include "Location.h"
#include "ISaveable.h"
#include "external/nlohmann/json.hpp"
#include <unordered_map>
#include <string>
#include <memory>
#include <vector>
namespace FRG {
enum class TutorialStep {
Step0, // Dialogue hint: "click to advance"
Step1, // Camera rotation hint
Step2, // Floor tap / walk hint
Step3, // Pinch-zoom hint
Step4, // Pick-up item hint
Step5, // Post-pickup reaction
Step6, // Tutorial complete
};
enum class UniIntTutorialState {
Step10,
Step11,
DarklandsActive,
DarklandsStep13,
DarklandsFull
};
struct StoredChatMessage {
std::string text;
bool incoming;
};
struct GameState : public ISaveable {
// --- World ---
std::unordered_map<std::string, std::shared_ptr<Location>> locations;
std::string currentLocationName;
bool isDarklands = false;
bool isNight = false;
bool isDawn = false;
// --- Player resources ---
Inventory inventory;
float playerHp = 200.f;
float playerMaxHp = 200.f;
int money = 5500;
// --- Script globals ---
std::unordered_map<std::string, int> globalInts;
std::unordered_map<std::string, float> globalFloats;
// --- Quest system ---
Quest::QuestJournal questJournal;
// --- Tutorial ---
TutorialStep tutorialStep = TutorialStep::Step0;
UniIntTutorialState uniIntTutorialState = UniIntTutorialState::Step10;
bool tutorialPhonePickedUp = false;
bool tutorialJournalPickedUp = false;
bool tutorialPhoneChatScreenOpened = false;
bool tutorialJournalScreenOpened = false;
bool tutorialNeedOpenTaxiScreen = false;
// --- Phone / chat ---
bool chatUnread[3] = { true, true, true };
std::string chatPreviewMsg[3];
std::vector<StoredChatMessage> chatHistory[3];
bool taxiIsCalled = false;
void save(nlohmann::json& out) const override;
void load(const nlohmann::json& in) override;
};
} // namespace FRG