Snapshot Class

Namespace: Improbable.Gdk.CoreSource

Convenience wrapper around the WorkerSDK Snapshot API.

Inheritance

IDisposable


Fields

Count Source
int Count


Methods

GetNextEntityId Source
EntityId GetNextEntityId()

Returns the next available entity ID.

Returns:
The next available entity ID.

Contains Source
bool Contains(EntityId entityId)

Checks if the snapshot contains an entity ID

Returns:
true if the snapshot contains the input entity ID, false otherwise

Parameters
  • EntityId entityId : The entity ID to check for

AddEntity Source
EntityId AddEntity(EntityTemplate entityTemplate)

Adds an entity to the snapshot

Returns:
The entity ID assigned to the entity in the snapshot.

Parameters
  • EntityTemplate entityTemplate : The entity to be added to the snapshot.

Notes:
  • The entity ID is automatically assigned.

AddEntity Source
void AddEntity(EntityId entityId, EntityTemplate entityTemplate)

Adds an entity to the snapshot

Parameters
  • EntityId entityId : The entity ID of the entity to be added to the snapshot
  • EntityTemplate entityTemplate : The entity to be added to the snapshot.

Notes:
  • You should obtain entityId using the GetNextEntityId() method, otherwise you could be given invalid entity IDs.

WriteToFile Source
void WriteToFile(string path)

Writes the snapshot out to a file.

Parameters
  • string path : The file path.

Dispose Source
void Dispose()

Updated about a year ago


Snapshot Class


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.