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


C++ IPlayerProfile::GetAttribute方法代码示例

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


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

示例1: GetProfileValue

bool COptionsManager::GetProfileValue(const char* key, string &value)
{
	if(!m_pPlayerProfileManager)
	{
		if(gEnv->pSystem->IsEditor())
		{
			if(strcmp(key, "ColorLine") == 0)
			{
				value = m_defaultColorLine;
			}
			else if(strcmp(key, "ColorOver") == 0)
			{
				value = m_defaultColorOver;
			}
			else if(strcmp(key, "ColorText") == 0)
			{
				value = m_defaultColorText;
			}
			else
			{
				value.clear();
			}
			return true;
		}
		return false;
	}

	IPlayerProfile *pProfile = m_pPlayerProfileManager->GetCurrentProfile(m_pPlayerProfileManager->GetCurrentUser());
	if(!pProfile) return false;

	return pProfile->GetAttribute(key, value);
}
开发者ID:mrwonko,项目名称:CrysisVR,代码行数:32,代码来源:OptionsManager.cpp

示例2: ProcessEvent

	virtual void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
	{
		switch(event)
		{
		case eFE_Activate:
			{
				if (IsPortActive(pActInfo, eIP_Get))
				{
					IPlayerProfile* pProfile = NULL;
					if (IPlayerProfileManager *pProfileMan = gEnv->pGame->GetIGameFramework()->GetIPlayerProfileManager())
					{
						const char* user = pProfileMan->GetCurrentUser();
						pProfile = pProfileMan->GetCurrentProfile(user);
						TFlowInputData data;
						if (!pProfile || pProfile->GetAttribute(GetPortString(pActInfo, eIP_Name), data))
						{
							ActivateOutput(pActInfo, eOP_Value, data);
						}
						else
						{
							ActivateOutput(pActInfo, eOP_Error, 1);
						}
					}
				}

				if (IsPortActive(pActInfo, eIP_Set))
				{
					IPlayerProfile* pProfile = NULL;
					if (IPlayerProfileManager *pProfileMan = gEnv->pGame->GetIGameFramework()->GetIPlayerProfileManager())
					{
						const char *user = pProfileMan->GetCurrentUser();
						pProfile = pProfileMan->GetCurrentProfile( user );
						if(!pProfile || !pProfile->SetAttribute(GetPortString(pActInfo, eIP_Name), GetPortAny(pActInfo, eIP_Set)))
						{
							ActivateOutput(pActInfo, eOP_Error, 1);
						}
					}
				}
			}
			break;
		}
	}
开发者ID:aronarts,项目名称:FireNET,代码行数:42,代码来源:FlowOnlineStatsNodes.cpp

示例3: UpdateSingleplayerDifficulties

void CFlashMenuObject::UpdateSingleplayerDifficulties()
{
	if(!m_apFlashMenuScreens[MENUSCREEN_FRONTENDSTART])
		return;

	if(!m_pPlayerProfileManager)
		return;

	IPlayerProfile *pProfile = m_pPlayerProfileManager->GetCurrentProfile(m_pPlayerProfileManager->GetCurrentUser());
	if(!pProfile)
		return;

	string sGeneralPath = "Singleplayer.Difficulty";
	int iDifficulties = 8;
/*	for(int i=0; i<EDifficulty_END; ++i)
	{
		string sPath = sGeneralPath;
		char c[5];
		itoa(i, c, 10);
		sPath.append(c);
		sPath.append(".available");

		TFlowInputData data;
		pProfile->GetAttribute(sPath, data, false);
		bool bDone = false;
		data.GetValueWithConversion(bDone);
		if(bDone)
		{
			iDifficulties += i*2;
		}
	}
*/
	int iDifficultiesDone = 0;
	for(int i=0; i<EDifficulty_END; ++i)
	{
		string sPath = sGeneralPath;
		char c[5];
		itoa(i, c, 10);
		sPath.append(c);
		sPath.append(".done");

		TFlowInputData data;
		pProfile->GetAttribute(sPath, data, false);
		bool bDone = false;
		data.GetValueWithConversion(bDone);
		if(bDone)
		{
			iDifficultiesDone += std::max(i*2,1);
		}
	}

	TFlowInputData data;
	pProfile->GetAttribute("Singleplayer.LastSelectedDifficulty", data, false);
	int iDiff = 2;
	data.GetValueWithConversion(iDiff);

	if(iDiff<=0)
	{
		iDiff = 2;
	}

	m_apFlashMenuScreens[MENUSCREEN_FRONTENDSTART]->Invoke("Root.MainMenu.SinglePlayer.enableDifficulties", iDifficulties);
	m_apFlashMenuScreens[MENUSCREEN_FRONTENDSTART]->Invoke("Root.MainMenu.SinglePlayer.enableDifficultiesStats", iDifficultiesDone);
	m_apFlashMenuScreens[MENUSCREEN_FRONTENDSTART]->Invoke("Root.MainMenu.SinglePlayer.selectDifficulty", iDiff);
}
开发者ID:RenEvo,项目名称:dead6,代码行数:65,代码来源:FlashMenuObjectSingleplayer.cpp


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