ForgeDocs
Documentation for the forge framework
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Pages
Forge.Entities.IGameSnapshot Interface Reference

The IGameSnapshot stores a serialized state of the engine. It provides a common interface that both the engine and the editor use for accessing saved games and replays. More...

Inherited by Forge.Entities.Implementation.Content.GameSnapshot.

Public Member Functions

IEntity CreateEntity (string prettyName="")
 Adds a new entity to the snapshot (under the Added entities collection). More...
 
GameSnapshotEntityRemoveResult RemoveEntity (IEntity entity)
 Request for the given entity to be removed from the snapshot. More...
 

Properties

IEntity GlobalEntity [get]
 The global entity. It is automatically created and cannot be destroyed, but it can be modified. More...
 
IEnumerable< IEntityActiveEntities [get]
 All entities in the game that were not added or removed in the previous update. More...
 
IEnumerable< IEntityRemovedEntities [get]
 All entities that were removed during the previous update. More...
 
IEnumerable< IEntityAddedEntities [get]
 All entities that were added during the previous update. More...
 
List< ISystemSystems [get]
 All systems that are used when executing the game. More...
 

Detailed Description

The IGameSnapshot stores a serialized state of the engine. It provides a common interface that both the engine and the editor use for accessing saved games and replays.

All implementations of this class must extend the MarshalByRefObject class, as IContentDatabase instances are passed around AppDomains. Similarly, all data that can be exposed by the content database, such as entities, also need to extend MarshalByRefObject.

Member Function Documentation

IEntity Forge.Entities.IGameSnapshot.CreateEntity ( string  prettyName = "")

Adds a new entity to the snapshot (under the Added entities collection).

Parameters
prettyNameThe pretty name of the entity.
Returns
A new entity.
GameSnapshotEntityRemoveResult Forge.Entities.IGameSnapshot.RemoveEntity ( IEntity  entity)

Request for the given entity to be removed from the snapshot.

This function does different operations depending on what collection the entity is currently in. If it is the GlobalEntity, an exception is thrown. If it is in AddedEntities, the entity is just destroyed completely. If it is in ActiveEntities, the entity is moved to RemovedEntities. If it is RemovedEntities, an exception is thrown.

Parameters
entityThe entity to remove.

Property Documentation

IEnumerable<IEntity> Forge.Entities.IGameSnapshot.ActiveEntities
get

All entities in the game that were not added or removed in the previous update.

IEnumerable<IEntity> Forge.Entities.IGameSnapshot.AddedEntities
get

All entities that were added during the previous update.

IEntity Forge.Entities.IGameSnapshot.GlobalEntity
get

The global entity. It is automatically created and cannot be destroyed, but it can be modified.

IEnumerable<IEntity> Forge.Entities.IGameSnapshot.RemovedEntities
get

All entities that were removed during the previous update.

List<ISystem> Forge.Entities.IGameSnapshot.Systems
get

All systems that are used when executing the game.


The documentation for this interface was generated from the following file: