Class AstarSerializer

Public

Handles low level serialization and deserialization of graph settings and data.

Mostly for internal use. You can use the methods in the AstarData class for higher level serialization and deserialization.

Public Methods

AstarSerializer (data)
Public
AstarSerializer (data, settings)
Public
CloseDeserialize ()
Public
CloseSerialize ()
Public
DeserializeEditorSettingsCompatibility ()

Deserializes graph editor settings.

Public
DeserializeExtraInfo ()

Deserializes extra graph info.

Public
DeserializeGraphs ()

Deserializes graph settings.

Public
GetChecksum ()
Public
OpenDeserialize (bytes)
Public
OpenSerialize ()
Public
PostDeserialization ()

Calls PostDeserialization on all loaded graphs.

Public
Serialize (graph)

Serializes the graph settings to JSON and returns the data.

Public
SerializeExtraInfo ()
Public
SerializeGraphs (_graphs)
Public
SetGraphIndexOffset (offset)
Public

Public Static Methods

LoadFromFile (path)

Load the specified data from the specified path.

Public Static
SaveToFile (path, data)

Save the specified data at the specified path.

Public Static

Public Static Variables

V3_8_3

Cached version object for 3.8.3.

Public Static Readonly
V3_9_0

Cached version object for 3.9.0.

Public Static Readonly
V4_1_0

Cached version object for 4.1.0.

Public Static Readonly

Private/Protected Members

_stringBuilder

Cached StringBuilder to avoid excessive allocations.

Private Static
AddChecksum (bytes)
Private
AddEntry (name, bytes)
Private
AnyDestroyedNodesInGraphs ()
Private
binaryExt

Extension to use for binary files.

Private
checksum

Checksum for the serialized data.

Private
ContainsEntry (name)
Private
data
Private
DeserializeBinaryMeta (entry)
Private
DeserializeExtraInfo (graph)
Private
DeserializeGraph (zipIndex, graphIndex)
Private
DeserializeMeta (entry)
Private
DeserializeNodeLinks (int2Node)
DeserializeNodeReferenceMap ()
Private
DeserializeNodeReferences (graph, int2Node)
Private
encoding
Private
FullyDefinedVersion (v)

Returns a version with all fields fully defined.

Private Static
GetBinaryReader (entry)

Returns a binary reader for the data in the zip entry.

Private Static
GetEntry (name)
Private
GetMaxNodeIndexInAllGraphs (graphs)
Private Static
GetString (entry)

Returns the data in the zip entry as a string.

Private Static
GetStringBuilder ()

Returns a cached StringBuilder.

Private Static
graphIndexInZip

Index used for the graph in the file.

Private
graphIndexOffset
Private
graphs

Graphs that are being serialized or deserialized.

Private
jsonExt

Extension to use for json files.

Private
meta

Graph metadata.

Private
SerializeGraphExtraInfo (graph)

Serializes info returned by NavGraph.SerializeExtraInfo.

Private Static
SerializeGraphNodeReferences (graph)

Used to serialize references to other nodes e.g connections.

Private Static
SerializeMeta ()

Serialize metadata about all graphs.

Private
SerializeNodeIndices (graphs)
Private Static
SerializeNodeLinks ()
settings

Settings for serialization.

Private
zip

Zip which the data is loaded from.

Private
zipStream

Memory stream with the zip data.

Private

Deprecated Members

SerializeNodes ()

Deprecated method to serialize node data.

Public