Table of Contents

Interface ISnapshotCapability

Namespace
KeenEyes.Capabilities
Assembly
KeenEyes.Abstractions.dll

Capability for world snapshot operations including creating and restoring world state.

public interface ISnapshotCapability

Remarks

This capability provides the operations needed for serializing and deserializing world state, including accessing all entities, components, and singletons.

The World class implements this capability. Plugin authors can use this interface to work with world snapshots without depending on the concrete World type.

Methods

Clear()

Clears all entities and state from the world.

void Clear()

GetAllSingletons()

Gets all singletons in the world as type/value pairs.

IEnumerable<(Type Type, object Value)> GetAllSingletons()

Returns

IEnumerable<(Type Type, object Value)>

An enumerable of singleton type and value pairs.

GetComponents(Entity)

Gets all components on an entity as type/value pairs.

IEnumerable<(Type Type, object Value)> GetComponents(Entity entity)

Parameters

entity Entity

The entity to get components from.

Returns

IEnumerable<(Type Type, object Value)>

An enumerable of component type and value pairs.

SetSingleton<T>(in T)

Sets a singleton value in the world.

void SetSingleton<T>(in T value) where T : struct

Parameters

value T

The singleton value.

Type Parameters

T

The singleton type. Must be a value type.