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.
Functions
Section titled “Functions”Get Resource
Section titled “Get Resource”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
Section titled “Get All Resources”Get all resources as a tag→float map.
TMap<FGameplayTag, float> GetAllResources() const;Get Resource Tags
Section titled “Get Resource Tags”Get the tags of all resources this player has.
TArray<FGameplayTag> GetResourceTags() const;Can Afford
Section titled “Can Afford”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;Has Tech Tag
Section titled “Has Tech Tag”Check if the player has a specific tech tag.
bool HasTechTag(FGameplayTag Tag) const;Get Unlocked Tech Tags
Section titled “Get Unlocked Tech Tags”The tags on the player’s entity, which include everything the player has researched or unlocked.
FGameplayTagContainer GetUnlockedTechTags() const;Event dispatchers
Section titled “Event dispatchers”On Refreshed
Section titled “On Refreshed”FOnPlayerViewModelRefreshed OnRefreshed
Fired after Refresh() updates cached data.
Properties
Section titled “Properties”Player ID
Section titled “Player ID”FSeinPlayerID PlayerID
Blueprint read-only
The player ID this ViewModel tracks.
Result
Section titled “Result”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.