Class SelectionSystem

Class Documentation

class SelectionSystem

Static utility class for managing entity selection state in the editor.

SelectionSystem provides scoped entity selection, where selections are tied to a scope entity (typically a scene). This allows different scenes or contexts to maintain independent selection states.

Public Static Functions

static void select(Entity entity, Entity scope)

Selects an entity within a given scope.

Parameters:
  • entity – The entity to select.

  • scope – The scope entity (e.g., scene) the selection belongs to.

static bool is_selected(Entity entity)

Checks if an entity is selected in any scope.

Parameters:

entity – The entity to check.

Returns:

True if the entity is selected.

static bool is_selected(Entity entity, Entity scope)

Checks if an entity is selected within a specific scope.

Parameters:
  • entity – The entity to check.

  • scope – The scope to check within.

Returns:

True if the entity is selected in the given scope.

static bool has_selection(Entity scope)

Checks if there is any selection within a scope.

Parameters:

scope – The scope to check.

Returns:

True if any entity is selected in the scope.

static Entity get_selected_entity(Entity scope)

Gets the currently selected entity in a scope.

Parameters:

scope – The scope to query.

Returns:

The selected entity, or an invalid entity if none selected.

static void deselect(Entity entity)

Deselects an entity from all scopes.

Parameters:

entity – The entity to deselect.

static void deselect(Entity entity, Entity scope)

Deselects an entity from a specific scope.

Parameters:
  • entity – The entity to deselect.

  • scope – The scope to deselect from.