-
Notifications
You must be signed in to change notification settings - Fork 0
WatchableList
Martin S. edited this page Feb 12, 2026
·
2 revisions
Namespace: VeryEpicEventPlugin.Utilities.MEC.EasyInheritance
Inherits: List<T>
Generic: The generic in Watchable list is the same as in List<T>
What is the point: This list is utility for Registerable system, which makes sure when element is added/removed that method will be called, it allows for the system to register certain events when X is registered and unregister without any issues or memory leaks.
Properties:
public Action<T>? OnAdd { get; set; }
public Action<T>? OnRemove { get; set; }
public Action? OnClear { get; set; }
These properties make actions on certain events of this list. OnAdd when element is added, OnRemove whem element is removed, OnClear when list is cleared.
OnClear makes sure every instance on list calls OnRemove before clearing list.
