SelectionSystemclass
An ordered collection of unique objects with add/remove callbacks. Maintains insertion order and provides change notifications.
Constructors1
Showing 1 constructors
public SelectionSystem()
No results match this filter.
Methods7
Showing 7 methods
public virtual bool Add(object obj)
Adds an object to the selection.
| Parameter | Type | Description |
|---|---|---|
| obj | object | The object to add |
boolTrue if the object was added, false if it was already selectedpublic virtual bool Any()
Checks if the selection contains any objects.
boolTrue if there are any selected objectspublic virtual void Clear()
Removes all objects from the selection, invoking OnItemRemoved for each.
void—public virtual bool Contains(object obj)
Checks if an object is in the selection.
| Parameter | Type | Description |
|---|---|---|
| obj | object | The object to check |
boolTrue if the object is selectedpublic virtual sealed System.Collections.Generic.IEnumerator`1<object> GetEnumerator()
Returns an enumerator that iterates through the selected objects in order.
IEnumerator<object>—public virtual bool Remove(object obj)
Removes an object from the selection.
| Parameter | Type | Description |
|---|---|---|
| obj | object | The object to remove |
boolTrue if the object was removed, false if it wasn't selectedpublic virtual bool Set(object obj)
Clears the selection and sets it to a single object.
| Parameter | Type | Description |
|---|---|---|
| obj | object | The object to select |
boolTrue if the selection changed, false if it was already the only selected objectNo results match this filter.
Properties3
Showing 3 properties
public int Sandbox.SelectionSystem.Count { get; set; }
Gets the number of selected objects.
int—public System.Action`1<object> Sandbox.SelectionSystem.OnItemAdded { get; set; }
Invoked when an item is added to the selection.
Action<object>—public System.Action`1<object> Sandbox.SelectionSystem.OnItemRemoved { get; set; }
Invoked when an item is removed from the selection.
Action<object>—No results match this filter.