Api Sandbox SelectionSystem
class

SelectionSystem

public class SelectionSystem

An ordered collection of unique objects with add/remove callbacks. Maintains insertion order and provides change notifications.

Constructors

SelectionSystem()

Properties

Name Type Description
OnItemAdded Action<Object> Invoked when an item is added to the selection.
OnItemRemoved Action<Object> Invoked when an item is removed from the selection.
Count Int32 Gets the number of selected objects.

Methods

virtual IEnumerator<Object> GetEnumerator()

Returns an enumerator that iterates through the selected objects in order.

virtual Void Clear()

Removes all objects from the selection, invoking OnItemRemoved for each.

virtual Boolean Add(Object obj)

Adds an object to the selection.

obj — The object to add
returns — True if the object was added, false if it was already selected
virtual Boolean Set(Object obj)

Clears the selection and sets it to a single object.

obj — The object to select
returns — True if the selection changed, false if it was already the only selected object
virtual Boolean Remove(Object obj)

Removes an object from the selection.

obj — The object to remove
returns — True if the object was removed, false if it wasn't selected
virtual Boolean Contains(Object obj)

Checks if an object is in the selection.

obj — The object to check
returns — True if the object is selected
virtual Boolean Any()

Checks if the selection contains any objects.

returns — True if there are any selected objects
Assembly: Sandbox.System Namespace: Sandbox Full Name: Sandbox.SelectionSystem