Table of Contents

Class NodeController<T>

Abstract reactive node wrapper that combines the Builder, Observer, and Bindable patterns into a single unit. Each node wraps a value of type T inside a Bindable<T> so that listeners are automatically notified on change. When the node is no longer needed, call Dispose() to broadcast its removal via OnRemoved.

public abstract class NodeController<T> : Builder<T>, IBuilder<T>, IEquatable<T>

Type Parameters

T

The data type wrapped by this node.

Inheritance
NodeController<T>
Implements
Inherited Members

Constructors

NodeController(T)

Initialises the node with an initial value.

public NodeController(T node)

Parameters

node T

The initial data value for this node.

Properties

CurrentNode

The underlying reactive value wrapped by this node.

public Bindable<T> CurrentNode { get; }

Property Value

Bindable<T>

OnRemoved

Fires when this node is disposed, passing the final node value to all listeners.

public ObserverPattern<T> OnRemoved { get; }

Property Value

ObserverPattern<T>

Methods

Build()

Returns the current node value (satisfies the Builder<T> contract).

public override T Build()

Returns

T

Dispose()

Signals removal of this node by notifying OnRemoved observers with the current node value.

public void Dispose()

Equals(T)

Indicates whether the current object is equal to another object of the same type.

public virtual bool Equals(T other)

Parameters

other T

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

~NodeController()

protected ~NodeController()

ForceTrigger()

Forces OnValueChanged to fire with the current value even if the value has not changed. Useful for initialisation-time binding.

public virtual void ForceTrigger()

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

UpdateNode(T)

Updates the node's value. Triggers OnValueChanged if the value changed.

public virtual void UpdateNode(T newValue)

Parameters

newValue T

The new value to assign.