|
A* Pathfinding Project
3.7
The A* Pathfinding Project for Unity 3D
|
Handles low level serialization and deserialization of graph settings and data. More...
Handles low level serialization and deserialization of graph settings and data.
Public Member Functions | |
| AstarSerializer (AstarData data) | |
| AstarSerializer (AstarData data, SerializeSettings settings) | |
| void | CloseDeserialize () |
| byte[] | CloseSerialize () |
| void | DeserializeEditorSettings (GraphEditorBase[] graphEditors) |
| Deserializes graph editor settings. | |
| void | DeserializeExtraInfo () |
| Deserializes extra graph info. | |
| NavGraph[] | DeserializeGraphs () |
| Deserializes graph settings. | |
| uint | GetChecksum () |
| bool | OpenDeserialize (byte[] bytes) |
| void | OpenSerialize () |
| void | PostDeserialization () |
| Calls PostDeserialization on all loaded graphs. | |
| byte[] | Serialize (NavGraph graph) |
| Serializes the graph settings to JSON and returns the data. | |
| void | SerializeEditorSettings (GraphEditorBase[] editors) |
| void | SerializeExtraInfo () |
| void | SerializeGraphs (NavGraph[] _graphs) |
| void | SerializeNodes () |
| void | SetGraphIndexOffset (int offset) |
Static Public Member Functions | |
| static byte[] | LoadFromFile (string path) |
| Load the specified data from the specified path. | |
| static void | SaveToFile (string path, byte[] data) |
| Save the specified data at the specified path. | |
Public Attributes | |
| JsonReaderSettings | readerSettings |
| JsonWriterSettings | writerSettings |
Private Member Functions | |
| void | AddChecksum (byte[] bytes) |
| GraphMeta | DeserializeMeta (ZipEntry entry) |
| string | GetString (ZipEntry entry) |
| Returns the data in the zip entry as a string. | |
| byte[] | SerializeMeta () |
| Serialize metadata about all graphs. | |
| byte[] | SerializeNodeConnections (int index) |
| Serialize node connections for given graph index. | |
| byte[] | SerializeNodes (int index) |
| Not used anymore. | |
Static Private Member Functions | |
| static System.Version | FullyDefinedVersion (System.Version v) |
| Returns a version with all fields fully defined. | |
| static System.Text.StringBuilder | GetStringBuilder () |
| Returns a cached StringBuilder. | |
Private Attributes | |
| const string | binaryExt = ".binary" |
| uint | checksum = 0xffffffff |
| AstarData | data |
| System.Text.UTF8Encoding | encoding =new System.Text.UTF8Encoding() |
| int | graphIndexOffset |
| NavGraph[] | graphs |
| const string | jsonExt = ".json" |
| GraphMeta | meta |
| SerializeSettings | settings |
| MemoryStream | str |
| ZipFile | zip |
Static Private Attributes | |
| static System.Text.StringBuilder | _stringBuilder = new System.Text.StringBuilder() |
| AstarSerializer | ( | AstarData | data | ) |
| AstarSerializer | ( | AstarData | data, |
| SerializeSettings | settings | ||
| ) |
|
private |
| void CloseDeserialize | ( | ) |
| byte [] CloseSerialize | ( | ) |
| void DeserializeEditorSettings | ( | GraphEditorBase[] | graphEditors | ) |
Deserializes graph editor settings.
For future compatibility this method does not assume that the graphEditors array matches the graphs array in order and/or count. It searches for a matching graph (matching if graphEditor.target == graph) for every graph editor. Multiple graph editors should not refer to the same graph.
| void DeserializeExtraInfo | ( | ) |
Deserializes extra graph info.
Extra graph info is specified by the graph types.
| NavGraph [] DeserializeGraphs | ( | ) |
Deserializes graph settings.
|
private |
|
staticprivate |
Returns a version with all fields fully defined.
This is used because by default new Version(3,0,0) > new Version(3,0). This is not the desired behaviour so we make sure that all fields are defined here
| uint GetChecksum | ( | ) |
|
private |
Returns the data in the zip entry as a string.
|
staticprivate |
Returns a cached StringBuilder.
This function only has one string builder cached and should thus only be called from a single thread and should not be called while using an earlier got string builder.
|
static |
Load the specified data from the specified path.
| bool OpenDeserialize | ( | byte[] | bytes | ) |
| void OpenSerialize | ( | ) |
| void PostDeserialization | ( | ) |
Calls PostDeserialization on all loaded graphs.
|
static |
Save the specified data at the specified path.
| byte [] Serialize | ( | NavGraph | graph | ) |
Serializes the graph settings to JSON and returns the data.
| void SerializeEditorSettings | ( | GraphEditorBase[] | editors | ) |
| void SerializeExtraInfo | ( | ) |
| void SerializeGraphs | ( | NavGraph[] | _graphs | ) |
|
private |
Serialize metadata about all graphs.
|
private |
Serialize node connections for given graph index.
| void SerializeNodes | ( | ) |
|
private |
Not used anymore.
| void SetGraphIndexOffset | ( | int | offset | ) |
|
staticprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
| JsonReaderSettings readerSettings |
|
private |
|
private |
| JsonWriterSettings writerSettings |
|
private |