Skip to content

Sein Player View Model

Class · USeinPlayerViewModel : UObject

#include "ViewModel/SeinPlayerViewModel.h"

Generic ViewModel for a player’s sim state.

Created and cached by USeinUISubsystem. Automatically refreshed each sim tick. All resource values are exposed as float for display purposes.

Get the current amount of a resource by tag. Returns 0 if the resource isn’t present.

float GetResource(FGameplayTag ResourceTag) const;

Get all resources as a tag→float map.

TMap<FGameplayTag, float> GetAllResources() const;

Get the tags of all resources this player has.

TArray<FGameplayTag> GetResourceTags() const;

True if the player has at least the given amount of every resource in Cost. A plain balance comparison that does not apply resource direction rules.

bool CanAfford(const TMap<FGameplayTag, float>& Cost) const;

Check if the player has a specific tech tag.

bool HasTechTag(FGameplayTag Tag) const;

The tags on the player’s entity, which include everything the player has researched or unlocked.

FGameplayTagContainer GetUnlockedTechTags() const;

FOnPlayerViewModelRefreshed OnRefreshed

Fired after Refresh() updates cached data.

FSeinPlayerID PlayerID

Blueprint read-only

The player ID this ViewModel tracks.

ESeinPlayerResult Result · default ESeinPlayerResult::None

Blueprint read-only

The player’s result: None while it plays on.

C++ members (2)
  • void Initialize(FSeinPlayerID InPlayerID, USeinWorldSubsystem* InWorldSubsystem); Initialize with a player ID and world subsystem reference.
  • void Refresh(); Refresh cached data from the simulation. Called each sim tick.