SavedDynamicObject
A class in Root.Township, Alta.Chunks.
One saved entity (with its child entities) as a prefab hash plus a packed bit stream. Chunk saves are lists of these, and StringVersion is the text form used by select tostring and spawn strings.
- Listed in World, chunks and saving
- Inherits or implements
IDisposable - Derived types
SerializedSavedDynamicObject
Constructors
| Member | What it is |
|---|---|
SavedDynamicObject(uint[] savingData, uint sizeInBytes, uint prefabHash) | Creates a SavedDynamicObject from savingData, sizeInBytes and prefabHash. |
SavedDynamicObject(List<uint[]> savingData, uint sizeInBytes, uint prefabHash) | Creates a SavedDynamicObject from savingData, sizeInBytes and prefabHash. |
Fields
| Member | What it is |
|---|---|
protected List<uint[]> data | Backing list for Data. |
protected uint hash | Backing field for Hash. |
protected uint messageSizeInBytes | Backing field for MessageSizeInBytes. |
2 private and internal fields
| Member | What it is |
|---|---|
private static Logger logger | NLog logger for this class. |
private static UnclearedPower2ArrayPool<uint> pool | Shared uint array pool the saved data arrays come from. |
Properties
Methods
| Member | What it is |
|---|---|
void Dispose() | Returns the data buffers to the pool. |
static SavedDynamicObject GetPositionlessSaveOf(NetworkEntity entity) | Saves an entity and its children without its position. |
static SavedDynamicObject GetSaveOf(NetworkEntity entity) | Saves an entity and its children in the latest save format. |
virtual ChunkVersioning GetVersion() | Save format versions of the data. The latest by default. |
static StreamWriter GetWriter(out List<uint[]> data) | Makes a stream writer that collects its output into pooled buffers. |
NetworkEntity Spawn(ChunkVersioning chunkVersioning) | Spawns the prefab and loads the saved data into it, without initializing. Null if the prefab doesn't exist. |
NetworkEntity SpawnOwned(ChunkVersioning chunkVersioning) | Spawns, runs load setup and initializes the entity and its children on the server. |
virtual string StringVersion() | Text form: hash, size, the data words, then | and the format versions. |
Used in
Members of other types that take, return or hold a SavedDynamicObject:
DynamicChunkContentManager.GetEmbeddedSave, DynamicChunkContentManager.LoadSerializeEmbeddedEntity, DynamicChunkContentManager.LoadSerializeEntity, DynamicChunkContentManager.LoadSingle, SavableSavedDynamicObject.op_Implicit, PickupDock.serializedData, DownedState.leftInteractorSave, DownedState.rightInteractorSave, DownedState.SpawnInteractableFromSave, DownedState.TrySaveInteractable, ChunkSaveFormat.LoadObject, ChunkSaveFormat.SaveObject, ChunkSaveFormat.Version.ChunkData, ChunkSaveFormat.Version.Objects, InGameInspector.ClonerTool.GetSaveOf, InGameInspector.ClonerTool.savedTool, SentGift.Setup.