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