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


C++ plString::Compare方法代码示例

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


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

示例1: AddAnim

// AddAnim ----------------------------------------------
// --------
void plAGAnim::AddAnim(const plString & name, plAGAnim *anim)
{
    // Only register the animation if it's got a "real" name. Unnamed animations
    // all get the same standard name.
    if(name.Compare(ENTIRE_ANIMATION_NAME) != 0)
    {
        hsAssert(anim, "registering nil anim");
        fAllAnims[name] = anim;
    }
}
开发者ID:Asteral,项目名称:Plasma,代码行数:12,代码来源:plAGAnim.cpp

示例2: GetPlayerIdByName

unsigned plNetClientMgr::GetPlayerIdByName (const plString & name) const {
    // local case
    if (name.CompareI(NetCommGetPlayer()->playerName) == 0)
        return NetCommGetPlayer()->playerInt;

    unsigned n = TransportMgr().GetNumMembers();
    for (unsigned i = 0; i < n; ++i)
        if (plNetTransportMember * member = TransportMgr().GetMember(i))
            if (0 == name.Compare(member->GetPlayerName()))
                return member->GetPlayerID();
    return 0;
}
开发者ID:MareinK,项目名称:Plasma,代码行数:12,代码来源:plNetClientMgr.cpp

示例3: ICreateLocation

plLocation plPluginResManager::ICreateLocation(const plString& age, const plString& page, int32_t seqNum, bool itinerant)
{
    bool willBeReserved = age.CompareI("global") == 0;

    int32_t oldNum = seqNum;
    seqNum = VerifySeqNumber(seqNum, age, page);
    if (seqNum != oldNum)
    {
        hsAssert(false, "Conflicting page sequence number. Somebody called NameToLoc without verifying their seq# first!"); 
    }

    if (seqNum < 0)
    {
        willBeReserved = true;
        seqNum = -seqNum;
    }

    plLocation newLoc;
    if (willBeReserved)
        newLoc = plLocation::MakeReserved(seqNum);
    else
        newLoc = plLocation::MakeNormal(seqNum);

    // Flag common pages
    for (int i = 0; i < plAgeDescription::kNumCommonPages; i++)
    {
        if (page.Compare(plAgeDescription::GetCommonPage(i)) == 0)
        {
            newLoc.SetFlags(plLocation::kBuiltIn);
            break;
        }
    }

    // If we have an age description file for the age we're creating a location
    // for, grab some extra flags from it
    plAgeDescription* ageDesc = plPageInfoUtils::GetAgeDesc(age.c_str());
    plAgePage* agePage = ageDesc ? ageDesc->FindPage(page.c_str()) : nil;
    if (agePage)
    {
        if (agePage->GetFlags() & plAgePage::kIsLocalOnly)
            newLoc.SetFlags(plLocation::kLocalOnly);

        if (agePage->GetFlags() & plAgePage::kIsVolatile)
            newLoc.SetFlags(plLocation::kVolatile);
    }
    if (itinerant)
        newLoc.SetFlags(plLocation::kItinerant);

    delete ageDesc;
    return newLoc;
}
开发者ID:Asteral,项目名称:Plasma,代码行数:51,代码来源:plPluginResManager.cpp


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