Agrarsense
Public Member Functions | Public Attributes | List of all members
UActorAssetGroupDataAsset Class Reference

#include <ActorAssetGroupDataAsset.h>

Inheritance diagram for UActorAssetGroupDataAsset:
Inheritance graph
[legend]
Collaboration diagram for UActorAssetGroupDataAsset:
Collaboration graph
[legend]

Public Member Functions

bool HasMultipleVariations ()
 
bool HasDefaultVariation ()
 
FActorAssetVariation GetDefaultVariation (bool &FoundVariation)
 
FActorAssetVariation FindVariationByUniqueIdentifier (const FString &UniqueIdentifierToFind, bool &FoundVariation)
 
 UActorAssetGroupDataAsset ()
 

Public Attributes

FString UniqueIdentifier
 
FText VariationText = NSLOCTEXT("Agrarsense", "Variation_Size", "Size")
 
FText DisplayName
 
TObjectPtr< UTexture2D > GroupTexture
 
FString DefaultVariation
 
TArray< FActorAssetVariationVariations
 

Detailed Description

Definition at line 19 of file ActorAssetGroupDataAsset.h.

Constructor & Destructor Documentation

◆ UActorAssetGroupDataAsset()

UActorAssetGroupDataAsset::UActorAssetGroupDataAsset ( )
inline

Definition at line 112 of file ActorAssetGroupDataAsset.h.

113 {
114 UniqueIdentifier = FGuid::NewGuid().ToString();
115 }

Member Function Documentation

◆ FindVariationByUniqueIdentifier()

FActorAssetVariation UActorAssetGroupDataAsset::FindVariationByUniqueIdentifier ( const FString &  UniqueIdentifierToFind,
bool &  FoundVariation 
)
inline

Find variation from the variations list by unique identifier key.

Parameters
UniqueIdentifierVariation's unique identifier
FoundVariationWas the variation found from the list
Returns
FActorAssetVariation Variation

Definition at line 97 of file ActorAssetGroupDataAsset.h.

98 {
99 for (const auto& Variation : Variations)
100 {
101 if (Variation.UniqueIdentifier == UniqueIdentifierToFind)
102 {
103 FoundVariation = true;
104 return Variation;
105 }
106 }
107
108 FoundVariation = false;
109 return FActorAssetVariation();
110 }
TArray< FActorAssetVariation > Variations

◆ GetDefaultVariation()

FActorAssetVariation UActorAssetGroupDataAsset::GetDefaultVariation ( bool &  FoundVariation)
inline

Get the default variation if one is found

Parameters
FoundVariationWas the variation found
Returns
FActorAssetVariation Default variation data

Definition at line 85 of file ActorAssetGroupDataAsset.h.

86 {
88 }
FActorAssetVariation FindVariationByUniqueIdentifier(const FString &UniqueIdentifierToFind, bool &FoundVariation)

◆ HasDefaultVariation()

bool UActorAssetGroupDataAsset::HasDefaultVariation ( )
inline

Has a default variation set = not empty (does not quarantee that variation with default variation's id actually exists in the list)

Returns
bool HasDefaultVariation

Definition at line 74 of file ActorAssetGroupDataAsset.h.

75 {
76 return !DefaultVariation.IsEmpty();
77 }

◆ HasMultipleVariations()

bool UActorAssetGroupDataAsset::HasMultipleVariations ( )
inline

Has more than one variation

Returns
bool HasMultipleVariations

Definition at line 64 of file ActorAssetGroupDataAsset.h.

65 {
66 return Variations.Num() >= 2;
67 }

Member Data Documentation

◆ DefaultVariation

FString UActorAssetGroupDataAsset::DefaultVariation

Unique identifier of the variation that should be selected as default

Definition at line 51 of file ActorAssetGroupDataAsset.h.

◆ DisplayName

FText UActorAssetGroupDataAsset::DisplayName

Name of the group. E.g. "Birch" or "Stone"

Definition at line 39 of file ActorAssetGroupDataAsset.h.

◆ GroupTexture

TObjectPtr<UTexture2D> UActorAssetGroupDataAsset::GroupTexture

Group's icon. E.g. if multiple sizes of birch, this could be icon of the the middle sized one.

Definition at line 45 of file ActorAssetGroupDataAsset.h.

◆ UniqueIdentifier

FString UActorAssetGroupDataAsset::UniqueIdentifier

Unique identifier to use for find/compare operations

Definition at line 28 of file ActorAssetGroupDataAsset.h.

◆ Variations

TArray<FActorAssetVariation> UActorAssetGroupDataAsset::Variations

Variation assets

Definition at line 57 of file ActorAssetGroupDataAsset.h.

◆ VariationText

FText UActorAssetGroupDataAsset::VariationText = NSLOCTEXT("Agrarsense", "Variation_Size", "Size")

Text to show on UI for hint to select different variation. E.g. "size" or "type" or "variation" depending on what actually changes between the variations.

Definition at line 33 of file ActorAssetGroupDataAsset.h.


The documentation for this class was generated from the following file: