Skip to content

Sein Entity View Model

Class · USeinEntityViewModel : UObject

#include "ViewModel/SeinEntityViewModel.h"

Generic ViewModel for any sim entity.

Created and cached by USeinUISubsystem. Automatically refreshed each sim tick. Widgets can:

  • Bind to BlueprintReadOnly properties via UMG native binding (auto-updates)

  • Bind to BlueprintCallable getters via UMG binding functions

  • Listen to OnRefreshed for event-driven updates

UI / Entity

A scalar field of one of the entity’s components as the simulation reads it, with every effect that modifies it applied: Fixed Point, integer, float, bool (1 or 0) or enum (its value). Field Name takes a field path like a modifier’s, such as Speed or VisionStamps[0].Radius. 0 when it can’t be found.

float GetAttribute(UScriptStruct* ComponentType, FName FieldName) const;

The same field without the effects that modify it, for displays such as “500 (+150)”.

float GetBaseAttribute(UScriptStruct* ComponentType, FName FieldName) const;

Check if the entity has a specific component type.

bool HasComponent(UScriptStruct* ComponentType) const;

Get a full copy of a component’s data as an FInstancedStruct. For advanced Blueprint use where the designer knows the component type. Returns an empty struct if the component is not present.

FInstancedStruct GetComponentData(UScriptStruct* ComponentType) const;

Get the entity’s current gameplay tags.

FGameplayTagContainer GetTags() const;

How a specific player sees this entity: friendly, enemy or neutral.

ESeinRelation GetRelationToPlayer(FSeinPlayerID PlayerID) const;

How the local player sees this entity: friendly, enemy or neutral.

ESeinRelation GetRelationToLocalPlayer() const;

Info for every ability on this entity. For a group, the group’s abilities and all its members’ are merged by ability tag. Abilities with no tag are left out.

TArray<FSeinAbilityInfo> GetAbilities() const;

Get ability info for a specific ability tag. Returns empty if not found.

FSeinAbilityInfo GetAbilityByTag(FGameplayTag Tag) const;

Check if the entity has an ability with the given tag.

bool HasAbilityWithTag(FGameplayTag Tag) const;

The entity’s production queue as UI-ready entries, front first, with icon and display name already resolved. Empty if the entity has no production queue or nothing is queued.

TArray<FSeinProductionQueueItemInfo> GetProductionQueue() const;

UI / Ability

Combines several Ability Info entries for the same ability tag into one. Name, icon, cost, total cooldown and passive flag come from the first entry. Enabled and Active are true if any entry is. On Cooldown is true only if all are. Cooldown Remaining is the shortest, so the display shows when the soonest unit can fire. Disabled Reason is None if any entry is enabled. An empty list returns an empty, invalid info. Do not mix different tags.

static FSeinAbilityInfo MergeAbilityInfos(const TArray<FSeinAbilityInfo>& Inputs);

FOnEntityViewModelRefreshed OnRefreshed

Fired after Refresh() updates cached data. Widgets bind to this for event-driven updates.

FOnEntityViewModelInvalidated OnInvalidated

Fired when the tracked entity is destroyed. Widgets should unbind and clear references.

FSeinEntityHandle Entity

Blueprint read-only

The entity handle this ViewModel tracks.

FText DisplayName

Blueprint read-only

Display name from Identity Data.

FText Description

Blueprint read-only

Description from Identity Data.

TObjectPtr<UTexture2D> Icon · default nullptr

Blueprint read-only

Icon texture from Identity Data.

TObjectPtr<UTexture2D> Portrait · default nullptr

Blueprint read-only

Portrait texture from Identity Data.

FGameplayTag IdentityTag

Blueprint read-only

Identity gameplay tag (from Identity Data).

FSeinPlayerID OwnerPlayerID

Blueprint read-only

Owning player ID.

bool bIsAlive · default false

Blueprint read-only

Whether the entity is still alive in the simulation.

C++ members (3)
  • void Initialize(FSeinEntityHandle InHandle, USeinWorldSubsystem* InWorldSubsystem); Initialize this ViewModel with an entity handle. Called by USeinUISubsystem when creating the ViewModel. Caches identity data from FSeinIdentityPayload.
  • void Refresh(); Refresh cached data from the simulation. Called by USeinUISubsystem each sim tick.
  • void Invalidate(); Mark this ViewModel as invalidated (entity destroyed). Fires OnInvalidated and clears data.