Table of Contents

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

List<TreeModifiedListener>

Properties

AllDirty

public bool AllDirty { get; }

Property Value

bool

PartialDirty

public bool PartialDirty { get; }

Property Value

bool

Methods

DirtyPathData(out string[], out byte[][])

public void DirtyPathData(out string[] paths, out byte[][] dirtydata)

Parameters

paths string[]
dirtydata byte[][]

FromBytes(BinaryReader)

public override void FromBytes(BinaryReader stream)

Parameters

stream BinaryReader

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

path string
data byte[]

RegisterModifiedListener(string, Action)

public void RegisterModifiedListener(string path, Action listener)

Parameters

path string
listener Action

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 string
value IAttribute

SetBool(string, bool)

Creates a bool attribute with given key and value

public override void SetBool(string key, bool value)

Parameters

key string
value bool

SetBytes(string, byte[])

Creates a byte[] attribute with given key and value

public override void SetBytes(string key, byte[] value)

Parameters

key string
value byte[]

SetDouble(string, double)

Creates a double attribute with given key and value

public override void SetDouble(string key, double value)

Parameters

key string
value double

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

key string
value float

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

key string
value int

SetLong(string, long)

Creates a long attribute with given key and value

public override void SetLong(string key, long value)

Parameters

key string
value long

SetString(string, string)

Creates a string attribute with given key and value

public override void SetString(string key, string value)

Parameters

key string
value string

UnregisterListener(Action)

public void UnregisterListener(Action listener)

Parameters

listener Action