Separating state out of the location
This commit is contained in:
1 parent
5e9a663812
commit
297bd7377f
45 files changed
+2114
-778
No files matched your search
@@ -0,0 +1,45 @@
|
||||
#pragma once
|
||||
|
||||
#include "IGameServer.h"
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class AudioPlayerAsync;
|
||||
|
||||
namespace FRG {
|
||||
|
||||
class Location;
|
||||
struct LocationConfig;
|
||||
struct LocationSetup;
|
||||
|
||||
// Client-only lifecycle and presentation integration for the in-process server.
|
||||
// The public gameplay contract remains IGameServer and is graphics-free.
|
||||
class IGameServerHost {
|
||||
public:
|
||||
virtual ~IGameServerHost() = default;
|
||||
|
||||
virtual void initializeCampaign(
|
||||
const std::string& campaignId, const std::string& questsPath,
|
||||
const std::string& zipFile) = 0;
|
||||
virtual void clearCampaign() = 0;
|
||||
virtual void resetCampaign(
|
||||
const std::string& questsPath, const std::string& zipFile) = 0;
|
||||
virtual bool prepareLocation(const LocationConfig& config) = 0;
|
||||
|
||||
virtual void setupRuntimeLocation(
|
||||
const std::string& id, const std::shared_ptr<Location>& location,
|
||||
LocationSetup params, AudioPlayerAsync* audioPlayer) = 0;
|
||||
virtual Location* runtimeLocation(const std::string& id) const = 0;
|
||||
virtual bool hasRuntimeLocation(const std::string& id) const = 0;
|
||||
virtual std::vector<std::string> loadedRuntimeLocationIds() const = 0;
|
||||
virtual void clearRuntimeLocations(bool retainState) = 0;
|
||||
virtual void bindRuntimeLocation(
|
||||
const std::string& id, std::shared_ptr<Location> location) = 0;
|
||||
|
||||
virtual void update(std::int64_t deltaMs) = 0;
|
||||
virtual void save(nlohmann::json& out) = 0;
|
||||
virtual void load(const nlohmann::json& in) = 0;
|
||||
};
|
||||
|
||||
} // namespace FRG
|
||||
Reference in new issue
Block a user