Adventure Creator 1.84.3
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2024
Loading...
Searching...
No Matches
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.
string GetSaveExtension ()
 Gets the extension of files that are saved in this format.
string SerializeObject< T > (object dataObject)
 Converts a serializeable object to a data string that can be saved to disk.
DeserializeObject< T > (string dataString)
 Converts a data string to an object that it represents.
string SerializeAllRoomData (List< SingleLevelData > dataObjects)
 Converts all scene data, as a List of SingleLevelData isntances, to a single string.
List< SingleLevelDataDeserializeAllRoomData (string dataString)
 Converts a data string to a List of SingleLevelData instances.
LoadScriptData< T > (string dataString)
 Converts a data string to a subclass of RememberData.

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 ();
static iFileFormatHandler FileFormatHandler
Definition SaveSystem.cs:2652

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_Binary, AC.FileFormatHandler_Json, and AC.FileFormatHandler_Xml.

◆ 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_Json, and AC.FileFormatHandler_Xml.

◆ 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_Binary, AC.FileFormatHandler_Json, and AC.FileFormatHandler_Xml.

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_Binary, AC.FileFormatHandler_Json, and AC.FileFormatHandler_Xml.

◆ 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.