Skip to content

SaveManager

Tommo J. Phillips edited this page Oct 22, 2023 · 2 revisions

SaveManager

Namespace: TommoJProductions.ModApi

Represents save and load logic.

public static class SaveManager

Inheritance ObjectSaveManager

Fields

positionTag

The position Identifier (Tag)

public static string positionTag;

rotationTag

The rotation Identiifer (Tag)

public static string rotationTag;

installedTag

The installed Identiifer (Tag)

public static string installedTag;

installPointIDTag

The install point id Identiifer (Tag)

public static string installPointIDTag;

boltTag

The bolts Identiifer (Tag)

public static string boltTag;

noneTag

The none (null) Identiifer (Tag)

public static string noneTag;

saveFile

The save file name including the file extention.

public static string saveFile;

Properties

identifier

Represents the pre identifier.

public static string identifier { get; }

Property Value

String

Methods

loadValue<T>(Part, String)

Loads a value using the s PartID combined with the . Creates an ES2Reader

public static T loadValue<T>(Part part, string id)

Type Parameters

T
The save type to load.

Parameters

part Part
The part to use its PartID.

id String
The id of the value to load

Returns

T
If value id is found returns the loaded value otherwise returns null.

loadValue<T>(Part, String, ES2Reader)

public static T loadValue<T>(Part part, string id, ES2Reader reader)

Type Parameters

T

Parameters

part Part

id String

reader ES2Reader

Returns

T

saveValue<T>(Part, String, T)

Saves a value using the s PartID combined with the . creates a writer.

public static void saveValue<T>(Part part, string id, T value)

Type Parameters

T
The save type to Save.

Parameters

part Part
The part to use its PartID.

id String
The id of the value to save

value T
The value to save.

saveValue<T>(Part, String, T, ES2Writer)

public static void saveValue<T>(Part part, string id, T value, ES2Writer writer)

Type Parameters

T

Parameters

part Part

id String

value T

writer ES2Writer

saveValue<T>(String, T, ES2Writer)

public static void saveValue<T>(string id, T value, ES2Writer writer)

Type Parameters

T

Parameters

id String

value T

writer ES2Writer

saveValue<T>(String, T)

Saves a value. Creates an ES2Writer

public static void saveValue<T>(string id, T value)

Type Parameters

T

Parameters

id String
The Identifier to save as

value T
the value to save.

loadValue<T>(String)

loads a value. Creates an ES2Reader

public static T loadValue<T>(string id)

Type Parameters

T

Parameters

id String
The Identifier to save as

Returns

T

loadValue<T>(String, ES2Reader)

public static T loadValue<T>(string id, ES2Reader reader)

Type Parameters

T

Parameters

id String

reader ES2Reader

Returns

T

loadValue<T>(String, T&, ES2Reader)

public static bool loadValue<T>(string id, T& value, ES2Reader reader)

Type Parameters

T

Parameters

id String

value T&

reader ES2Reader

Returns

Boolean

exists(String)

if the identifier exists in the es2 modapi save file.

public static bool exists(string id)

Parameters

id String

Returns

Boolean

loadPart(String)

Loads Part save info. if does not exist. returns .

public static PartSaveInfo loadPart(string id)

Parameters

id String
The identifier of the part save info to get.

Returns

PartSaveInfo
found part save info or .

readOrDefault<T>(String, ES2Reader)

public static T readOrDefault<T>(string id, ES2Reader reader)

Type Parameters

T

Parameters

id String

reader ES2Reader

Returns

T

savePart(Part, ES2Writer)

internal static void savePart(Part part, ES2Writer writer)

Parameters

part Part

writer ES2Writer

saveTrigger(Trigger, ES2Writer)

internal static void saveTrigger(Trigger trigger, ES2Writer writer)

Parameters

trigger Trigger

writer ES2Writer

loadBolts(String)

Loads bolts from es2 using the Tag . Creates an ES2Reader.

internal static Int32[] loadBolts(string id)

Parameters

id String
The id of the bolts to load.

Returns

Int32[]
If found returns loaded bolts, Otherwise returns .

loadBolts(String, ES2Reader)

internal static Int32[] loadBolts(string id, ES2Reader reader)

Parameters

id String

reader ES2Reader

Returns

Int32[]

saveBolts(String, Int32[])

internal static void saveBolts(string id, Int32[] boltTightness)

Parameters

id String

boltTightness Int32[]

saveBolts(String, Int32[], ES2Writer)

internal static void saveBolts(string id, Int32[] boltTightness, ES2Writer writer)

Parameters

id String

boltTightness Int32[]

writer ES2Writer

Clone this wiki locally