Sein Selection Model
Class · USeinSelectionModel : UObject
#include "ViewModel/SeinSelectionModel.h"
Tracks the current selection and provides entity ViewModels for selected units.
Owned by USeinUISubsystem. Automatically listens to the player controller’s OnSelectionChanged delegate and rebuilds its ViewModel list.
Functions
Section titled “Functions”Get Selected View Models
Section titled “Get Selected View Models”Get ViewModels for all currently selected entities.
TArray<USeinEntityViewModel*> GetSelectedViewModels() const;Get Focused View Model
Section titled “Get Focused View Model”Get the ViewModel for the focused entity. Returns nullptr if active focus is “All” (-1).
USeinEntityViewModel* GetFocusedViewModel() const;Get Primary View Model
Section titled “Get Primary View Model”Get the “primary” ViewModel: the focused entity if one is focused, otherwise the first selected entity. Returns nullptr if nothing is selected.
USeinEntityViewModel* GetPrimaryViewModel() const;Get Selection Count
Section titled “Get Selection Count”Get the number of currently selected entities.
int32 GetSelectionCount() const;Get Active Focus Index
Section titled “Get Active Focus Index”Get the active focus index (-1 = “All”, 0+ = specific entity).
int32 GetActiveFocusIndex() const;Is Entity Selected
Section titled “Is Entity Selected”Check if a specific entity is in the current selection.
bool IsEntitySelected(FSeinEntityHandle Handle) const;Is Entity Focused
Section titled “Is Entity Focused”Check if a specific entity is the currently focused entity.
bool IsEntityFocused(FSeinEntityHandle Handle) const;Get Selection Abilities
Section titled “Get Selection Abilities”The abilities available across the whole selection, one entry per ability tag with the entries of every selected unit merged. Use it for an action panel that shows everything the selection can do.
TArray<FSeinAbilityInfo> GetSelectionAbilities() const;Get Selection Ability By Tag
Section titled “Get Selection Ability By Tag”The merged info for one ability across the selection. Returns an empty, invalid info if no selected entity has it.
FSeinAbilityInfo GetSelectionAbilityByTag(FGameplayTag Tag) const;Selection Has Ability With Tag
Section titled “Selection Has Ability With Tag”True if any selected entity, or any member of a selected group, has the ability.
bool SelectionHasAbilityWithTag(FGameplayTag Tag) const;Event dispatchers
Section titled “Event dispatchers”On Selection Changed
Section titled “On Selection Changed”FOnSelectionModelChanged OnSelectionChanged
Fired when the selection or active focus changes.
Network functions
Section titled “Network functions”Handle Selection Changed
Section titled “Handle Selection Changed”void HandleSelectionChanged();Called when the player controller’s selection changes.
C++ members (4)
void Initialize(USeinUISubsystem* InOwningSubsystem);Initialize. Binds to the player controller’s selection delegate if one is already available.void Deinitialize();Unbind from delegates.void EnsurePlayerControllerBound();Bind to the local player controller’s OnSelectionChanged if we haven’t yet. Cheap no-op once bound. Called every sim tick by the UI subsystem so we catch the PC once it spawns (WorldSubsystem init runs before PC creation).void InvalidateAbilityCache();Mark selection-wide ability state stale for the next UI read. Called once after each completed simulation frame. The first action-panel query rebuilds the aggregate; every other Blueprint binding/event in that presentation frame reuses it instead of rescanning the whole selection.