Skip to content

Commit

Permalink
Expose some state manipulation functions to gateway
Browse files Browse the repository at this point in the history
  • Loading branch information
albert-wang committed Aug 13, 2024
1 parent 10fd1a7 commit e17b2d5
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
14 changes: 14 additions & 0 deletions gamelink_single.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30033,6 +30033,20 @@ namespace gateway
void SetGameVector4(const string& label, const float* ptr);
void SetGameVector4WithComponents(const string& label, float x, float y, float z, float w);

// Low level set game access. Sets a serializable array to the json path.
template<typename T>
void UpdateGameStatePathWithArray(const string& path, const T* begin, const T* end)
{
Base.UpdateStateWithArray(gamelink::StateTarget::Channel, path, begin, end);
}

// Low level set game access. Sets an serializable object to the json path.
template<typename T>
void UpdateGameStatePathWithObject(const string& path, const T& obj)
{
Base.UpdateStateWithObject(gamelink::StateTarget::Channel, path, obj);
}

RequestID SetGameMetadata(GameMetadata Meta);

string GetProjectionSandboxURL(const string& projection, int major, int minor, int patch) const;
Expand Down
14 changes: 14 additions & 0 deletions include/gateway.h
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,20 @@ namespace gateway
void SetGameVector4(const string& label, const float* ptr);
void SetGameVector4WithComponents(const string& label, float x, float y, float z, float w);

// Low level set game access. Sets a serializable array to the json path.
template<typename T>
void UpdateGameStatePathWithArray(const string& path, const T* begin, const T* end)
{
Base.UpdateStateWithArray(gamelink::StateTarget::Channel, gamelink::Operation::Add, path, begin, end);
}

// Low level set game access. Sets an serializable object to the json path.
template<typename T>
void UpdateGameStatePathWithObject(const string& path, const T& obj)
{
Base.UpdateStateWithObject(gamelink::StateTarget::Channel, gamelink::Operation::Add, path, obj);
}

RequestID SetGameMetadata(GameMetadata Meta);

string GetProjectionSandboxURL(const string& projection, int major, int minor, int patch) const;
Expand Down

0 comments on commit e17b2d5

Please sign in to comment.