Class SyncedTreeAttribute
- Namespace
- Vintagestory.API.Datastructures
- Assembly
- VintagestoryAPI.dll
public class SyncedTreeAttribute : TreeAttribute, ITreeAttribute, IAttribute, IEnumerable<KeyValuePair<string, IAttribute>>, IEnumerable
- Inheritance
-
SyncedTreeAttribute
- Implements
- Inherited Members
- Extension Methods
Fields
OnModified
public List<TreeModifiedListener> OnModified
Field Value
Properties
AllDirty
public bool AllDirty { get; }
Property Value
PartialDirty
public bool PartialDirty { get; }
Property Value
Methods
FromBytes(BinaryReader)
public override void FromBytes(BinaryReader stream)
Parameters
stream
BinaryReader
GetDirtyPathData(out string[], out byte[][])
public void GetDirtyPathData(out string[] paths, out byte[][] dirtydata)
Parameters
GetDirtyPathData(FastMemoryStream, out string[], out byte[][])
public void GetDirtyPathData(FastMemoryStream ms, out string[] paths, out byte[][] dirtydata)
Parameters
ms
FastMemoryStreampaths
string[]dirtydata
byte[][]
MarkAllDirty()
Marks the whole attribute tree as dirty, so that it will be resent to all connected clients. Does not trigger modified listeners (because it makes no sense and breaks things)
public void MarkAllDirty()
MarkClean()
public void MarkClean()
MarkPathDirty(string)
Marks part of the attribute tree as dirty, allowing for a partial update of the attribute tree. Has no effect it the whole tree is already marked dirty. If more than 5 paths are marked dirty it will wipe the list of dirty paths and just marked the whole tree as dirty
public void MarkPathDirty(string path)
Parameters
path
string
PartialUpdate(string, byte[])
public void PartialUpdate(string path, byte[] data)
Parameters
RegisterModifiedListener(string, Action)
public void RegisterModifiedListener(string path, Action listener)
Parameters
RemoveAttribute(string)
Removes an attribute
public override void RemoveAttribute(string key)
Parameters
key
string
SetAttribute(string, IAttribute)
public override void SetAttribute(string key, IAttribute value)
Parameters
key
stringvalue
IAttribute
SetBool(string, bool)
Creates a bool attribute with given key and value
public override void SetBool(string key, bool value)
Parameters
SetBytes(string, byte[])
Creates a byte[] attribute with given key and value
public override void SetBytes(string key, byte[] value)
Parameters
SetDouble(string, double)
Creates a double attribute with given key and value
public override void SetDouble(string key, double value)
Parameters
SetFloat(string, float)
Creates a float attribute with given key and value
Side note: If you need this attribute to be compatible with deserialized json - use SetDouble()
public override void SetFloat(string key, float value)
Parameters
SetInt(string, int)
Creates an int attribute with given key and value
Side note: If you need this attribute to be compatible with deserialized json - use SetLong()
public override void SetInt(string key, int value)
Parameters
SetLong(string, long)
Creates a long attribute with given key and value
public override void SetLong(string key, long value)
Parameters
SetString(string, string)
Creates a string attribute with given key and value
public override void SetString(string key, string value)
Parameters
UnregisterListener(Action)
public void UnregisterListener(Action listener)
Parameters
listener
Action