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

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...
 
string SerializeObject< T > (object dataObject)
 Converts a serializeable object to a data string that can be saved to disk. More...
 
DeserializeObject< T > (string dataString)
 Converts a data string to an object that it represents More...
 
string SerializeAllRoomData (List< SingleLevelData > dataObjects)
 Converts all scene data, as a List of SingleLevelData isntances, to a single string More...
 
List< SingleLevelDataDeserializeAllRoomData (string dataString)
 Converts a data string to a List of SingleLevelData instances More...
 
LoadScriptData< T > (string dataString)
 Converts a data string to a subclass of RememberData More...
 

Detailed Description

An interface for classes that handle the conversion of data to saveable strings and vice-versa. These classes do not handle the disk-handling, only the conversion of data.

To override the format of save files, create a new class that implements iFileFormatHandler, and assign it with:

SaveSystem.FileFormatHandler = new MyClassName ();

Where MyClassName is the name of your class.

To have this code run when the game begins, place it in the Awake function of a script in your game's first scene.

Member Function Documentation

◆ DeserializeAllRoomData()

List<SingleLevelData> AC.iFileFormatHandler.DeserializeAllRoomData ( string  dataString)

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

Implemented in AC.FileFormatHandler_Json, AC.FileFormatHandler_Xml, and AC.FileFormatHandler_Binary.

◆ DeserializeObject< T >()

T AC.iFileFormatHandler.DeserializeObject< T > ( string  dataString)

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

Implemented in AC.FileFormatHandler_Binary, AC.FileFormatHandler_Xml, and AC.FileFormatHandler_Json.

◆ GetSaveExtension()

string AC.iFileFormatHandler.GetSaveExtension ( )

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

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

Implemented in AC.FileFormatHandler_Binary, AC.FileFormatHandler_Json, and AC.FileFormatHandler_Xml.

◆ GetSaveMethod()

string AC.iFileFormatHandler.GetSaveMethod ( )

Gets the name of the file format.

Returns
The name of the file format.

Implemented in AC.FileFormatHandler_Binary, AC.FileFormatHandler_Json, and AC.FileFormatHandler_Xml.

◆ LoadScriptData< T >()

T AC.iFileFormatHandler.LoadScriptData< T > ( string  dataString)

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

Implemented in AC.FileFormatHandler_Json, AC.FileFormatHandler_Xml, and AC.FileFormatHandler_Binary.

Type Constraints
T :RememberData 

◆ SerializeAllRoomData()

string AC.iFileFormatHandler.SerializeAllRoomData ( List< SingleLevelData dataObjects)

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

Implemented in AC.FileFormatHandler_Json, AC.FileFormatHandler_Xml, and AC.FileFormatHandler_Binary.

◆ SerializeObject< T >()

string AC.iFileFormatHandler.SerializeObject< T > ( object  dataObject)

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

Implemented in AC.FileFormatHandler_Binary, AC.FileFormatHandler_Json, and AC.FileFormatHandler_Xml.