Skip to content

File ScriptVariableSync.hpp

File List > Engine > include > Scripting > ScriptVariableSync.hpp

Go to the documentation of this file

#ifndef ENGINE_SCRIPTING_SCRIPTVARIABLESYNC_HPP_
#define ENGINE_SCRIPTING_SCRIPTVARIABLESYNC_HPP_

#include "ECS/Entity.hpp"

#include <cstddef>
#include <glaze/glaze.hpp>
#include <string>
#include <vector>

namespace Engine {
class Registry;
}

namespace Engine::Multiplayer {

bool ReadScriptVariables(Registry& registry, Entity entity, const std::vector<std::string>& fields,
                         glz::generic::object_t& out);

bool WriteScriptVariables(Registry& registry, Entity entity, const glz::generic::object_t& vars);

void ApplyReplicatedScriptVariables(Registry& registry, std::size_t networkId, Entity entity,
                                    const glz::generic::object_t& vars);

void ResolvePendingScriptVariables(Registry& registry, Entity entity, std::size_t networkId);

} // namespace Engine::Multiplayer

#endif // ENGINE_SCRIPTING_SCRIPTVARIABLESYNC_HPP_