本文整理汇总了C++中CGameContext::Tuning方法的典型用法代码示例。如果您正苦于以下问题:C++ CGameContext::Tuning方法的具体用法?C++ CGameContext::Tuning怎么用?C++ CGameContext::Tuning使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGameContext
的用法示例。
在下文中一共展示了CGameContext::Tuning方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ConTuneDump
void CGameContext::ConTuneDump(IConsole::IResult *pResult, void *pUserData)
{
CGameContext *pSelf = (CGameContext *)pUserData;
for(int i = 0; i < pSelf->Tuning()->Num(); i++)
{
float v;
pSelf->Tuning()->Get(i, &v);
dbg_msg("tuning", "%s %.2f", pSelf->Tuning()->m_apNames[i], v);
}
}
示例2: ConTuneDump
void CGameContext::ConTuneDump(IConsole::IResult *pResult, void *pUserData)
{
CGameContext *pSelf = (CGameContext *)pUserData;
char aBuf[256];
for(int i = 0; i < pSelf->Tuning()->Num(); i++)
{
float v;
pSelf->Tuning()->Get(i, &v);
str_format(aBuf, sizeof(aBuf), "%s %.2f", pSelf->Tuning()->m_apNames[i], v);
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "tuning", aBuf);
}
}
示例3: ConTuneReset
void CGameContext::ConTuneReset(IConsole::IResult *pResult, void *pUserData)
{
CGameContext *pSelf = (CGameContext *)pUserData;
CTuningParams TuningParams;
*pSelf->Tuning() = TuningParams;
pSelf->SendTuningParams(-1);
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "tuning", "Tuning reset");
}
示例4: ConTuneReset
void CGameContext::ConTuneReset(IConsole::IResult *pResult, void *pUserData)
{
CGameContext *pSelf = (CGameContext *)pUserData;
CTuningParams p;
*pSelf->Tuning() = p;
pSelf->SendTuningParams(-1);
dbg_msg("tuning", "Tuning reset");
}
示例5: ConTuneParam
void CGameContext::ConTuneParam(IConsole::IResult *pResult, void *pUserData)
{
CGameContext *pSelf = (CGameContext *)pUserData;
const char *pParamName = pResult->GetString(0);
float NewValue = pResult->GetFloat(1);
if(pSelf->Tuning()->Set(pParamName, NewValue))
{
dbg_msg("tuning", "%s changed to %.2f", pParamName, NewValue);
pSelf->SendTuningParams(-1);
}
else
dbg_msg("tuning", "No such tuning parameter");
}
示例6: ConTuneParam
void CGameContext::ConTuneParam(IConsole::IResult *pResult, void *pUserData)
{
CGameContext *pSelf = (CGameContext *)pUserData;
const char *pParamName = pResult->GetString(0);
float NewValue = pResult->GetFloat(1);
if(pSelf->Tuning()->Set(pParamName, NewValue))
{
char aBuf[256];
str_format(aBuf, sizeof(aBuf), "%s changed to %.2f", pParamName, NewValue);
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "tuning", aBuf);
pSelf->SendTuningParams(-1);
}
else
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "tuning", "No such tuning parameter");
}