Adventure Creator  1.79.1
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2022
AC.FileFormatHandler_Json Class Reference
Inheritance diagram for AC.FileFormatHandler_Json:
AC.iFileFormatHandler

Public Member Functions

string GetSaveMethod ()
 Gets the name of the file format. More...
 
string GetSaveExtension ()
 Gets the extension of files that are saved in this format. More...
 
virtual string SerializeObject< T > (object dataObject)
 Converts a serializeable object to a data string that can be saved to disk. More...
 
virtual T DeserializeObject< T > (string dataString)
 Converts a data string to an object that it represents More...
 
virtual string SerializeAllRoomData (List< SingleLevelData > dataObjects)
 Converts all scene data, as a List of SingleLevelData isntances, to a single string More...
 
virtual List< SingleLevelDataDeserializeAllRoomData (string dataString)
 Converts a data string to a List of SingleLevelData instances More...
 
virtual T LoadScriptData< T > (string dataString)
 Converts a data string to a subclass of RememberData More...
 

Protected Member Functions

virtual object DeserializeObjectJson< T > (string jsonString)
 

Static Protected Attributes

const string roomDelimiter = "|ROOMDELIMITER|"
 

Detailed Description

A format handler that serializes data into Json format

Member Function Documentation

◆ DeserializeAllRoomData()

virtual List<SingleLevelData> AC.FileFormatHandler_Json.DeserializeAllRoomData ( string  dataString)
virtual

Converts a data string to a List of SingleLevelData instances

Parameters
dataStringThe List of SingleLevelData, represented as a serialized string
Returns
The List of SingleLevelData instances, deserialized from the string

Implements AC.iFileFormatHandler.

◆ DeserializeObject< T >()

virtual T AC.FileFormatHandler_Json.DeserializeObject< T > ( string  dataString)
virtual

Converts a data string to an object that it represents

Parameters
dataStringThe object represented as a serialized string
Returns
The object, deserialized from the string

Implements AC.iFileFormatHandler.

◆ GetSaveExtension()

string AC.FileFormatHandler_Json.GetSaveExtension ( )

Gets the extension of files that are saved in this format.

Returns
The extension of files that are saved in this format.

Implements AC.iFileFormatHandler.

◆ GetSaveMethod()

string AC.FileFormatHandler_Json.GetSaveMethod ( )

Gets the name of the file format.

Returns
The name of the file format.

Implements AC.iFileFormatHandler.

◆ LoadScriptData< T >()

virtual T AC.FileFormatHandler_Json.LoadScriptData< T > ( string  dataString)
virtual

Converts a data string to a subclass of RememberData

Parameters
dataStringThe RememberData subclass, represented as a serialized string
Returns
The RememberData subclass, deserialized from the string

Implements AC.iFileFormatHandler.

Type Constraints
T :RememberData 

◆ SerializeAllRoomData()

virtual string AC.FileFormatHandler_Json.SerializeAllRoomData ( List< SingleLevelData dataObjects)
virtual

Converts all scene data, as a List of SingleLevelData isntances, to a single string

Parameters
dataObjectsThe scene data to serialize
Returns
The scene data, serialized as a string

Implements AC.iFileFormatHandler.

◆ SerializeObject< T >()

virtual string AC.FileFormatHandler_Json.SerializeObject< T > ( object  dataObject)
virtual

Converts a serializeable object to a data string that can be saved to disk.

Parameters
dataObjectThe object to convert
Returns
The object, serialized as a string

Implements AC.iFileFormatHandler.