MetaDataclass

A class to CRUD json files. This should probably be a generic class since it seems like we might want to do this with stuff other than meta files. But there's no need for that right now, so lets leave it simple.

object→MetaData
Namespace
Editor
Assembly
Sandbox.Tools
Declaration
public class Editor.MetaData

Methods8

Showing 8 methods

public T Get(string keyName, T defaultValue = null)PUBLIC

ParameterTypeDescription
keyNamestring—
defaultValue = nullT—
Returns:T—

public bool GetBool(string keyName, bool defaultValue = False)PUBLIC

ParameterTypeDescription
keyNamestring—
defaultValue = Falsebool—
Returns:bool—

public System.Nullable`1<System.Text.Json.JsonElement> GetElement(string keyName)PUBLIC

ParameterTypeDescription
keyNamestring—
Returns:Nullable<JsonElement>—

public float GetFloat(string keyName, float defaultValue = 0)PUBLIC

ParameterTypeDescription
keyNamestring—
defaultValue = 0float—
Returns:float—

public int GetInt(string keyName, int defaultValue = 0)PUBLIC

ParameterTypeDescription
keyNamestring—
defaultValue = 0int—
Returns:int—

public string GetString(string keyName, string defaultValue = null)PUBLIC

ParameterTypeDescription
keyNamestring—
defaultValue = nullstring—
Returns:string—

public void Set(string name, T value)PUBLIC

Set a value in the metadata file. If the value is null, the key will be removed.

ParameterTypeDescription
namestring—
valueT—
Returns:void—

public bool TryGet(string keyName, T value)PUBLIC

ParameterTypeDescription
keyNamestring—
valueT—
Returns:bool—

Properties1

Showing 1 properties

public string Editor.MetaData.FilePath { get; set; }PUBLICGETSET

File path to the metadata file.

Returns:string—

On this page