Show / Hide Table of Contents

Class TrackedCollectionExtensions

Inheritance
System.Object
TrackedCollectionExtensions
Namespace: Eco.Core.Utils
Assembly: Eco.Core.dll
Syntax
public static class TrackedCollectionExtensions : Object

Methods

ApplyChange(ITrackedControllerEnumerable, Action)

We apply the specified changes and then notify.

Declaration
public static void ApplyChange(this ITrackedControllerEnumerable list, Action change)
Parameters
Type Name Description
ITrackedControllerEnumerable list
System.Action change

ApplyChange<T>(ITrackedControllerEnumerable, Func<T>)

We apply the specified changes and return what's needed and then notify.

Declaration
public static T ApplyChange<T>(this ITrackedControllerEnumerable list, Func<T> change)
Parameters
Type Name Description
ITrackedControllerEnumerable list
System.Func<T> change
Returns
Type Description
T
Type Parameters
Name Description
T

ApplyChangeConditional(ITrackedControllerEnumerable, Func<Boolean>)

We try to apply the changes and if we were succesful we notify. We return whether we were able to apply the changes or not.

Declaration
public static bool ApplyChangeConditional(this ITrackedControllerEnumerable list, Func<bool> change)
Parameters
Type Name Description
ITrackedControllerEnumerable list
System.Func<System.Boolean> change
Returns
Type Description
System.Boolean

NotifyChanged(ITrackedControllerEnumerable)

We notify the parent of this controller list and the list itself that it was changed (somethings were adedd/removed).

Declaration
public static void NotifyChanged(this ITrackedControllerEnumerable list)
Parameters
Type Name Description
ITrackedControllerEnumerable list

OnCurrentAndFutureEntries<T>(ITrackedEnumerable, Action<INetObject, T>, ISubscriptions<ThreadSafeSubscriptions>, Action<INetObject, T>)

Use watcher in order to have easy way to unsubscribe by Unwatch in object.

Declaration
public static void OnCurrentAndFutureEntries<T>(this ITrackedEnumerable list, Action<INetObject, T> func, ISubscriptions<ThreadSafeSubscriptions> watcher, Action<INetObject, T> funcUndo = null)
Parameters
Type Name Description
ITrackedEnumerable list
System.Action<INetObject, T> func
ISubscriptions<ThreadSafeSubscriptions> watcher
System.Action<INetObject, T> funcUndo
Type Parameters
Name Description
T
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾