当前位置: 首页>>代码示例>>C++>>正文


C++ FName::GetComparisonIndex方法代码示例

本文整理汇总了C++中FName::GetComparisonIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ FName::GetComparisonIndex方法的具体用法?C++ FName::GetComparisonIndex怎么用?C++ FName::GetComparisonIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FName的用法示例。


在下文中一共展示了FName::GetComparisonIndex方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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"));

    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());
}
开发者ID:Art1stical,项目名称:AHRUnrealEngine,代码行数:25,代码来源:UnrealNames.cpp

示例2: SerializeName

bool UPackageMap::SerializeName(FArchive& Ar, FName& Name)
{
	if (Ar.IsLoading())
	{
		uint8 bHardcoded = 0;
		Ar.SerializeBits(&bHardcoded, 1);
		if (bHardcoded)
		{
			// replicated by hardcoded index
			uint32 NameIndex;
			Ar.SerializeInt(NameIndex, MAX_NETWORKED_HARDCODED_NAME + 1);
			Name = EName(NameIndex);
			// hardcoded names never have a Number
		}
		else
		{
			// replicated by string
			FString InString;
			int32 InNumber;
			Ar << InString << InNumber;
			Name = FName(*InString, InNumber);
		}
	}
	else if (Ar.IsSaving())
	{
		uint8 bHardcoded = Name.GetComparisonIndex() <= MAX_NETWORKED_HARDCODED_NAME;
		Ar.SerializeBits(&bHardcoded, 1);
		if (bHardcoded)
		{
			// send by hardcoded index
			checkSlow(Name.GetNumber() <= 0); // hardcoded names should never have a Number
			uint32 NameIndex = uint32(Name.GetComparisonIndex());
			Ar.SerializeInt(NameIndex, MAX_NETWORKED_HARDCODED_NAME + 1);
		}
		else
		{
			// send by string
			FString OutString = Name.GetPlainNameString();
			int32 OutNumber = Name.GetNumber();
			Ar << OutString << OutNumber;
		}
	}
	return true;
}
开发者ID:Foreven,项目名称:Unreal4-1,代码行数:44,代码来源:CoreNet.cpp


注:本文中的FName::GetComparisonIndex方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。