ForgeDocs
Documentation for the forge framework
|
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< IEntity > | ActiveEntities [get] |
All entities in the game that were not added or removed in the previous update. More... | |
IEnumerable< IEntity > | RemovedEntities [get] |
All entities that were removed during the previous update. More... | |
IEnumerable< IEntity > | AddedEntities [get] |
All entities that were added during the previous update. More... | |
List< ISystem > | Systems [get] |
All systems that are used when executing the game. More... | |
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.
IEntity Forge.Entities.IGameSnapshot.CreateEntity | ( | string | prettyName = "" | ) |
Adds a new entity to the snapshot (under the Added entities collection).
prettyName | The pretty name of the 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.
entity | The entity to remove. |
|
get |
All entities in the game that were not added or removed in the previous update.
|
get |
All entities that were added during the previous update.
|
get |
The global entity. It is automatically created and cannot be destroyed, but it can be modified.
|
get |
All entities that were removed during the previous update.
|
get |
All systems that are used when executing the game.