本文整理汇总了C++中shared_str::equal方法的典型用法代码示例。如果您正苦于以下问题:C++ shared_str::equal方法的具体用法?C++ shared_str::equal怎么用?C++ shared_str::equal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类shared_str
的用法示例。
在下文中一共展示了shared_str::equal方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetFieldValue
s32 UITeamState::GetFieldValue(shared_str const & field_name) const
{
if (field_name.equal("mp_artefacts_upcase"))
{
return m_artefact_count;
} else if (field_name.equal("mp_players"))
{
return static_cast<s32>(myPlayers.size());
} else if (field_name.equal("mp_frags_upcase"))
{
return GetSummaryFrags();
}
return -1;
}
示例2: GetIconParamValue
void UIPlayerItem::GetIconParamValue(game_PlayerState const * ps,
shared_str const & param_name,
buffer_vector<char> & dest)
{
VERIFY(ps);
game_cl_mp* cl_game = static_cast<game_cl_mp*>(&Game());
VERIFY(cl_game);
if (param_name.equal("rank"))
{
if (ETeam(cl_game->ModifyTeam(ps->team)) == etGreenTeam)
{
sprintf_s(dest.begin(), dest.size(), "ui_hud_status_green_0%d", ps->rank + 1);
} else if (ETeam(cl_game->ModifyTeam(ps->team)) == etBlueTeam)
{
sprintf_s(dest.begin(), dest.size(), "ui_hud_status_blue_0%d", ps->rank + 1);
}
} else if (param_name.equal("death_atf"))
{
if (ps->testFlag(GAME_PLAYER_FLAG_VERY_VERY_DEAD))
{
strcpy_s(dest.begin(), dest.size(), "death");
return;
}
if (cl_game->Type() == eGameIDCaptureTheArtefact)
{
game_cl_CaptureTheArtefact* cta_cl_game = static_cast<game_cl_CaptureTheArtefact*>(cl_game);
R_ASSERT(cta_cl_game);
if (ps->GameID == cta_cl_game->GetGreenArtefactOwnerID() ||
ps->GameID == cta_cl_game->GetBlueArtefactOwnerID())
{
strcpy_s(dest.begin(), dest.size(), "artefact");
}
} else if (cl_game->Type() == eGameIDArtefactHunt)
{
game_cl_ArtefactHunt* ahunt_cl_game = static_cast<game_cl_ArtefactHunt*>(cl_game);
R_ASSERT(ahunt_cl_game);
if (ps->GameID == ahunt_cl_game->artefactBearerID)
{
strcpy_s(dest.begin(), dest.size(), "artefact");
}
}
} else
{
VERIFY2(false, make_string("unknown icon parameter: %s", param_name.c_str()).c_str());
}
}
示例3: GetTextParamValue
void UIPlayerItem::GetTextParamValue(game_PlayerState const * ps,
shared_str const & param_name,
buffer_vector<char> & dest)
{
VERIFY(ps);
if (param_name.equal("mp_name"))
{
strcpy_s(dest.begin(), dest.size(), ps->name);
} else if (param_name.equal("mp_frags"))
{
sprintf_s(dest.begin(), dest.size(), "%d", ps->m_iRivalKills - ps->m_iSelfKills);
} else if (param_name.equal("mp_deaths"))
{
sprintf_s(dest.begin(), dest.size(), "%d", ps->m_iDeaths);
} else if (param_name.equal("mp_artefacts"))
{
sprintf_s(dest.begin(), dest.size(), "%d", ps->af_count);
} else if (param_name.equal("mp_spots"))
{
sprintf_s(dest.begin(), dest.size(), "%d", m_checkPoints);
}else if (param_name.equal("mp_status"))
{
CStringTable st;
if (ps->testFlag(GAME_PLAYER_FLAG_READY))
strcpy_s(dest.begin(), dest.size(), st.translate("st_mp_ready").c_str());
} else if (param_name.equal("mp_ping"))
{
sprintf_s(dest.begin(), dest.size(), "%d", ps->ping);
}
}