本文整理汇总了C++中FName::IsNone方法的典型用法代码示例。如果您正苦于以下问题:C++ FName::IsNone方法的具体用法?C++ FName::IsNone怎么用?C++ FName::IsNone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FName
的用法示例。
在下文中一共展示了FName::IsNone方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadRow
bool FDataTableImporterJSON::ReadRow(const TSharedRef<FJsonObject>& InParsedTableRowObject, const int32 InRowIdx)
{
// Get row name
FName RowName = DataTableUtils::MakeValidName(InParsedTableRowObject->GetStringField(TEXT("Name")));
// Check its not 'none'
if (RowName.IsNone())
{
ImportProblems.Add(FString::Printf(TEXT("Row '%d' missing a name."), InRowIdx));
return false;
}
// Check its not a duplicate
if (DataTable->RowMap.Find(RowName) != nullptr)
{
ImportProblems.Add(FString::Printf(TEXT("Duplicate row name '%s'."), *RowName.ToString()));
return false;
}
// Allocate data to store information, using UScriptStruct to know its size
uint8* RowData = (uint8*)FMemory::Malloc(DataTable->RowStruct->PropertiesSize);
DataTable->RowStruct->InitializeStruct(RowData);
// And be sure to call DestroyScriptStruct later
if (auto UDStruct = Cast<const UUserDefinedStruct>(DataTable->RowStruct))
{
UDStruct->InitializeDefaultValue(RowData);
}
// Add to row map
DataTable->RowMap.Add(RowName, RowData);
return ReadStruct(InParsedTableRowObject, DataTable->RowStruct, RowName, RowData);
}
示例2: FindIconNameImpl
FName FClassIconFinder::FindIconNameImpl(const UClass* InClass, const FName& InDefaultName, const TCHAR* StyleRoot )
{
FName BrushName;
const FSlateBrush* Brush = nullptr;
if ( InClass )
{
// walk up class hierarchy until we find an icon
const UClass* CurrentClass = InClass;
while( !Brush && CurrentClass )
{
BrushName = *FString::Printf( TEXT( "%s.%s" ), StyleRoot, *CurrentClass->GetName() );
Brush = FClassIconFinder::LookupBrush( BrushName );
CurrentClass = CurrentClass->GetSuperClass();
}
}
if( !Brush )
{
// If we didn't supply an override name for the default icon use default class icon.
if( InDefaultName.IsNone() )
{
BrushName = *FString::Printf( TEXT( "%s.Default" ), StyleRoot);
}
else
{
BrushName = InDefaultName;
}
}
return BrushName;
}
示例3: AutoTest
void FName::AutoTest()
{
const FName AutoTest_1("AutoTest_1");
const FName autoTest_1("autoTest_1");
const FName autoTeSt_1("autoTeSt_1");
const FName AutoTest1Find("autoTEST_1", EFindName::FNAME_Find);
const FName AutoTest_2(TEXT("AutoTest_2"));
const FName AutoTestB_2(TEXT("AutoTestB_2"));
const FName NullName(static_cast<ANSICHAR*>(nullptr));
check(AutoTest_1 != AutoTest_2);
check(AutoTest_1 == autoTest_1);
check(AutoTest_1 == autoTeSt_1);
#if WITH_CASE_PRESERVING_NAME
check(!FCString::Strcmp(*AutoTest_1.ToString(), TEXT("AutoTest_1")));
check(!FCString::Strcmp(*autoTest_1.ToString(), TEXT("autoTest_1")));
check(!FCString::Strcmp(*autoTeSt_1.ToString(), TEXT("autoTeSt_1")));
check(!FCString::Strcmp(*AutoTestB_2.ToString(), TEXT("AutoTestB_2")));
#endif
check(autoTest_1.GetComparisonIndex() == AutoTest_2.GetComparisonIndex());
check(autoTest_1.GetPlainNameString() == AutoTest_1.GetPlainNameString());
check(autoTest_1.GetPlainNameString() == AutoTest_2.GetPlainNameString());
check(*AutoTestB_2.GetPlainNameString() != *AutoTest_2.GetPlainNameString());
check(AutoTestB_2.GetNumber() == AutoTest_2.GetNumber());
check(autoTest_1.GetNumber() != AutoTest_2.GetNumber());
check(NullName.IsNone());
}
示例4: FindParent
FTreeItemPtr FActorTreeItem::FindParent(const FTreeItemMap& ExistingItems) const
{
AActor* ActorPtr = Actor.Get();
if (!ActorPtr)
{
return nullptr;
}
// Parents should have already been added to the tree
AActor* ParentActor = ActorPtr->GetAttachParentActor();
if (ParentActor)
{
return ExistingItems.FindRef(ParentActor);
}
else
{
const bool bShouldShowFolders = SharedData->Mode == ESceneOutlinerMode::ActorBrowsing || SharedData->bOnlyShowFolders;
const FName ActorFolder = ActorPtr->GetFolderPath();
if (bShouldShowFolders && !ActorFolder.IsNone())
{
return ExistingItems.FindRef(ActorFolder);
}
}
if (UWorld* World = ActorPtr->GetWorld())
{
return ExistingItems.FindRef(World);
}
return nullptr;
}
示例5: GetDefaultFolderName
FName FActorFolders::GetDefaultFolderName(UWorld& InWorld, FName ParentPath)
{
// This is potentially very slow but necessary to find a unique name
const auto& ExistingFolders = GetFolderPropertiesForWorld(InWorld);
// Create a valid base name for this folder
uint32 Suffix = 1;
FText LeafName = FText::Format(LOCTEXT("DefaultFolderNamePattern", "NewFolder{0}"), FText::AsNumber(Suffix++));
FString ParentFolderPath = ParentPath.IsNone() ? TEXT("") : ParentPath.ToString();
if (!ParentFolderPath.IsEmpty())
{
ParentFolderPath += "/";
}
FName FolderName(*(ParentFolderPath + LeafName.ToString()));
while (ExistingFolders.Contains(FolderName))
{
LeafName = FText::Format(LOCTEXT("DefaultFolderNamePattern", "NewFolder{0}"), FText::AsNumber(Suffix++));
FolderName = FName(*(ParentFolderPath + LeafName.ToString()));
if (Suffix == 0)
{
// We've wrapped around a 32bit unsigned int - something must be seriously wrong!
return FName();
}
}
return FolderName;
}
示例6: FindIconNameForActor
FName FClassIconFinder::FindIconNameForActor( const TWeakObjectPtr<AActor>& InActor )
{
// Actor specific overrides to normal per-class icons
AActor* Actor = InActor.Get();
FName BrushName = NAME_None;
if ( Actor )
{
ABrush* Brush = Cast< ABrush >( Actor );
if ( Brush )
{
if (Brush_Add == Brush->BrushType)
{
BrushName = TEXT( "ClassIcon.BrushAdditive" );
}
else if (Brush_Subtract == Brush->BrushType)
{
BrushName = TEXT( "ClassIcon.BrushSubtractive" );
}
}
// Actor didn't specify an icon - fallback on the class icon
if ( BrushName.IsNone() )
{
BrushName = FindIconNameForClass( Actor->GetClass() );
}
}
else
{
// If the actor reference is NULL it must have been deleted
BrushName = TEXT( "ClassIcon.Deleted" );
}
return BrushName;
}
示例7: CreateParent
FTreeItemPtr FActorTreeItem::CreateParent() const
{
AActor* ActorPtr = Actor.Get();
if (!ActorPtr)
{
return nullptr;
}
AActor* ParentActor = ActorPtr->GetAttachParentActor();
if (ParentActor)
{
return MakeShareable(new FActorTreeItem(ParentActor));
}
else
{
const bool bShouldShowFolders = SharedData->Mode == ESceneOutlinerMode::ActorBrowsing || SharedData->bOnlyShowFolders;
const FName ActorFolder = ActorPtr->GetFolderPath();
if (bShouldShowFolders && !ActorFolder.IsNone())
{
return MakeShareable(new FFolderTreeItem(ActorFolder));
}
}
if (UWorld* World = ActorPtr->GetWorld())
{
return MakeShareable(new FWorldTreeItem(World));
}
return nullptr;
}
示例8: OnLatentTaskAdded
void UGAAbilityBase::OnLatentTaskAdded(FName InstanceName, class UAFTaskBase* TaskIn)
{
if (!InstanceName.IsNone())
{
AbilityTasks.Add(InstanceName, TaskIn);
}
};
示例9: SetFloatValue
void UARAttributeBaseComponent::SetFloatValue(float InValue, FName AttributeName)
{
if (AttributeName.IsNone())
return;
UNumericProperty* NumericProperty = CastChecked<UNumericProperty>(GetAttribute(AttributeName));
void* pValue = NumericProperty->ContainerPtrToValuePtr<void>(this);
NumericProperty->SetFloatingPointPropertyValue(pValue, InValue);
}
示例10: AddClass
void FNativeClassHierarchy::AddClass(UClass* InClass, const TSet<FName>& InGameModules, const TMap<FName, FName>& InPluginModules, FAddClassMetrics& AddClassMetrics)
{
// Ignore deprecated and temporary classes
if(InClass->HasAnyClassFlags(CLASS_Deprecated | CLASS_NewerVersionExists) || FKismetEditorUtilities::IsClassABlueprintSkeleton(InClass))
{
return;
}
const FName ClassModuleName = GetClassModuleName(InClass);
if(ClassModuleName.IsNone())
{
return;
}
static const FName ModuleRelativePathMetaDataKey = "ModuleRelativePath";
const FString& ClassModuleRelativeIncludePath = InClass->GetMetaData(ModuleRelativePathMetaDataKey);
if(ClassModuleRelativeIncludePath.IsEmpty())
{
return;
}
// Work out which root this class should go under
const FName RootNodeName = GetClassPathRootForModule(ClassModuleName, InGameModules, InPluginModules);
// Work out the final path to this class within the hierarchy (which isn't the same as the path on disk)
const FString ClassModuleRelativePath = ClassModuleRelativeIncludePath.Left(ClassModuleRelativeIncludePath.Find(TEXT("/"), ESearchCase::CaseSensitive, ESearchDir::FromEnd));
const FString ClassHierarchyPath = ClassModuleName.ToString() + TEXT("/") + ClassModuleRelativePath;
// Ensure we've added a valid root node
TSharedPtr<FNativeClassHierarchyNode>& RootNode = RootNodes.FindOrAdd(RootNodeName);
if(!RootNode.IsValid())
{
RootNode = FNativeClassHierarchyNode::MakeFolderEntry(RootNodeName, TEXT("/") + RootNodeName.ToString());
++AddClassMetrics.NumFoldersAdded;
}
// Split the class path and ensure we have nodes for each part
TArray<FString> HierarchyPathParts;
ClassHierarchyPath.ParseIntoArray(HierarchyPathParts, TEXT("/"), true);
TSharedPtr<FNativeClassHierarchyNode> CurrentNode = RootNode;
for(const FString& HierarchyPathPart : HierarchyPathParts)
{
const FName HierarchyPathPartName = *HierarchyPathPart;
TSharedPtr<FNativeClassHierarchyNode>& ChildNode = CurrentNode->Children.FindOrAdd(FNativeClassHierarchyNodeKey(HierarchyPathPartName, ENativeClassHierarchyNodeType::Folder));
if(!ChildNode.IsValid())
{
ChildNode = FNativeClassHierarchyNode::MakeFolderEntry(HierarchyPathPartName, CurrentNode->EntryPath + TEXT("/") + HierarchyPathPart);
++AddClassMetrics.NumFoldersAdded;
}
CurrentNode = ChildNode;
}
// Now add the final entry for the class
CurrentNode->AddChild(FNativeClassHierarchyNode::MakeClassEntry(InClass, ClassModuleName, ClassModuleRelativePath, CurrentNode->EntryPath + TEXT("/") + InClass->GetName()));
++AddClassMetrics.NumClassesAdded;
}
示例11:
void
CreatureCore::SetBluePrintRegionAlpha(FName region_name_in, uint8 alpha_in)
{
if (region_name_in.IsNone())
{
return;
}
region_alpha_map.Add(region_name_in, alpha_in);
}
示例12: GetIntValue
int32 UARAttributeBaseComponent::GetIntValue(FName AttributeName)
{
if (AttributeName.IsNone())
return 0;
UIntProperty* intProperty = CastChecked<UIntProperty>(GetAttribute(AttributeName));
//UNumericProperty* NumericProperty = CastChecked<UNumericProperty>(GetAttribute(AttributeName));
void* pValue = intProperty->ContainerPtrToValuePtr<void>(this);
return intProperty->GetUnsignedIntPropertyValue(pValue);
}
示例13: SetNumericValue
void URPGAttributeComponent::SetNumericValue(float value, FName AttributeName)
{
if (!AttributeName.IsNone())
{
UNumericProperty* NumericProperty = CastChecked<UNumericProperty>(GetAttribute(AttributeName, this->GetClass()));
void* ValuePtr = NumericProperty->ContainerPtrToValuePtr<void>(this);
NumericProperty->SetFloatingPointPropertyValue(ValuePtr, value);
OnAttributeChange.Broadcast(AttributeName, value);
}
}
示例14: GetNumericValue
float URPGAttributeComponent::GetNumericValue(FName AttributeName)
{
if (!AttributeName.IsNone())
{
UNumericProperty* NumericProperty = CastChecked<UNumericProperty>(GetAttribute(AttributeName, this->GetClass()));
void* ValuePtr = NumericProperty->ContainerPtrToValuePtr<void>(this);
float tempVal = 0;
tempVal = NumericProperty->GetFloatingPointPropertyValue(ValuePtr);
return tempVal;
}
return 0;
}
示例15: ReadRow
bool FDataTableImporterJSON::ReadRow(const TSharedRef<FJsonObject>& ParsedTableRowObject, const int32 RowIdx)
{
// Get row name
FName RowName = DataTableUtils::MakeValidName(ParsedTableRowObject->GetStringField(TEXT("Name")));
// Check its not 'none'
if (RowName.IsNone())
{
ImportProblems.Add(FString::Printf(TEXT("Row '%d' missing a name."), RowIdx));
return false;
}
// Check its not a duplicate
if (DataTable->RowMap.Find(RowName) != nullptr)
{
ImportProblems.Add(FString::Printf(TEXT("Duplicate row name '%s'."), *RowName.ToString()));
return false;
}
// Allocate data to store information, using UScriptStruct to know its size
uint8* RowData = (uint8*)FMemory::Malloc(DataTable->RowStruct->PropertiesSize);
DataTable->RowStruct->InitializeStruct(RowData);
// And be sure to call DestroyScriptStruct later
if (auto UDStruct = Cast<const UUserDefinedStruct>(DataTable->RowStruct))
{
UDStruct->InitializeDefaultValue(RowData);
}
// Add to row map
DataTable->RowMap.Add(RowName, RowData);
// Now read in each property
for (TFieldIterator<UProperty> It(DataTable->RowStruct); It; ++It)
{
UProperty* BaseProp = *It;
check(BaseProp);
const FString PropertyName = BaseProp->GetName();
TSharedPtr<FJsonValue> ParsedPropertyValue = ParsedTableRowObject->TryGetField(PropertyName);
if (!ParsedPropertyValue.IsValid())
{
ImportProblems.Add(FString::Printf(TEXT("Row '%s' is missing an entry for '%s'."), *RowName.ToString(), *PropertyName));
continue;
}
void* Data = BaseProp->ContainerPtrToValuePtr<void>(RowData, 0);
ReadStructEntry(ParsedPropertyValue.ToSharedRef(), RowName, RowData, BaseProp, Data);
}
return true;
}