24 lines
874 B
C++
24 lines
874 B
C++
#pragma once
|
|
// Small test double for the PORT command's interaction with the existing quest engine.
|
|
#include <map>
|
|
#include <string>
|
|
namespace quest {
|
|
struct PC {
|
|
std::map<std::string, int> flags;
|
|
bool running = false, loaded = true;
|
|
int GetFlag(const std::string& key) { return flags[key]; }
|
|
void SetFlag(const std::string& key, int value, bool = false) { flags[key] = value; }
|
|
bool IsRunning() const { return running; }
|
|
bool IsLoaded() const { return loaded; }
|
|
};
|
|
struct CQuestManager {
|
|
PC pc;
|
|
int dispatched = 0;
|
|
bool available = true;
|
|
static CQuestManager& instance() { static CQuestManager manager; return manager; }
|
|
PC* GetPCForce(unsigned) { return &pc; }
|
|
unsigned GetQuestIndexByName(const std::string&) { return available ? 1 : 0; }
|
|
void QuestButton(unsigned, unsigned) { ++dispatched; pc.running = true; }
|
|
};
|
|
}
|