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


C++ Message::AddFloat方法代码示例

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


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

示例1: SendNormalMessages

void Bombing::SendNormalMessages() 
{
	// Check if there was a bomb
	if(mNormalBombingPlayers.size() == 0)
		return;
		
	// First to Planet Owner
	Message * mess = mTargetPlanet->AddMessageOwner("PlanetBombed");
	mess->AddItem("Target", this);
	mess->AddLong("Population lost", mPopulationLoss);
	mess->AddFloat("Defense effectiveness", mNormalPercentageStopped);
	mess->AddLong("Factories lost", mFactoriesLoss);
	mess->AddLong("Mines lost", mMinesLoss);
	mess->AddLong("Defenses lost", mDefensesLoss);
	
	// Other Players
	for (deque<Player*>::iterator i = mNormalBombingPlayers.begin(); i != mNormalBombingPlayers.end(); ++i)
	{
		Message * mess = (*i)->AddMessage("FleetBombed");
		mess->AddItem("Target", this);
		mess->AddLong("Population lost", mPopulationLoss);
		mess->AddFloat("Defense effectiveness", mNormalPercentageStopped);
		mess->AddLong("Installations lost", mFactoriesLoss + mMinesLoss + mDefensesLoss);
	}
}
开发者ID:Zardoz89,项目名称:freestars-code,代码行数:25,代码来源:Bombing.cpp

示例2: HandleMessage

void CameraPrefsWin::HandleMessage(Message* pcMessage)
{
	switch (pcMessage->GetCode())
	{
		case M_PREFS_APPLY:
			{
				int nKeyInstant = m_pcInstantDrop->GetSelection();
				int nKeyDelay = m_pcDelayDrop->GetSelection();
				int nClickPreform = m_pcSingleClickDrop->GetSelection();

				pcPassToWindow = new Message(M_PREFS_SEND_TO_PARENT);
				pcPassToWindow->AddFloat("delay",(float)m_pcKeySecondDrop->GetSelection()+1);
				pcPassToWindow->AddFloat("key/instant",(float)nKeyInstant);
				pcPassToWindow->AddFloat("key/delay",(float)nKeyDelay);
				pcPassToWindow->AddFloat("click",(float)nClickPreform);
				m_pcParent->GetLooper()->PostMessage(pcPassToWindow,m_pcParent);
				delete( pcPassToWindow );
				break;
			}
			
		case M_PREFS_UNDO:
			LoadSettings();
			break;
		
		case M_PREFS_DEFAULT:
			LoadDefaults();
			break;
	}
}
开发者ID:rickcaudill,项目名称:Pyro,代码行数:29,代码来源:Camera.cpp

示例3: GetConfig

void AppserverConfig::GetConfig( Message * pcConfig )
{
	const char *pzKeymap = strrchr( m_cKeymapPath.c_str(), '/' );

	if( pzKeymap == NULL )
	{
		pzKeymap = m_cKeymapPath.c_str();
	}
	else
	{
		pzKeymap++;
	}
	pcConfig->AddString( "keymap", pzKeymap );
	pcConfig->AddString( "window_decorator", m_cWindowDecoratorPath );
	pcConfig->AddBool( "popoup_sel_win", m_bPopupSelectedWindows );
	pcConfig->AddInt64( "doubleclick_delay", m_nDoubleClickDelay );
	pcConfig->AddInt64( "key_delay", m_nKeyDelay );
	pcConfig->AddInt64( "key_repeat", m_nKeyRepeat );
	pcConfig->AddFloat( "mouse_speed", m_nMouseSpeed );
	pcConfig->AddFloat( "mouse_acceleration", m_nMouseAcceleration );
	pcConfig->AddBool(  "mouse_swap_buttons", m_bMouseSwapButtons );

	Message cColorConfig;

	cColorConfig.AddFloat( "shine_tint", 0.9f );
	cColorConfig.AddFloat( "shadow_tint", 0.9f );
	for( int i = 0; i < COL_COUNT; ++i )
	{
		cColorConfig.AddColor32( "color_table", get_default_color( static_cast < default_color_t > ( i ) ) );
	}
	pcConfig->AddMessage( "color_config", &cColorConfig );

}
开发者ID:rickcaudill,项目名称:Pyro,代码行数:33,代码来源:config.cpp

示例4: ShowPrefs

void DockCamera::ShowPrefs(Path cPath)
{
	if (!pcPrefsWin)
	{
		m_pcPassedToPrefsMessage = new Message(M_PARENT_SEND_TO_PREFS);
		m_pcPassedToPrefsMessage->AddFloat("delay",vDelayTime-1);
		m_pcPassedToPrefsMessage->AddFloat("key/instant",vInstant);
		m_pcPassedToPrefsMessage->AddFloat("key/delay",vDelay);
		m_pcPassedToPrefsMessage->AddFloat("click",vClick);
		
		pcPrefsWin = new CameraPrefsWin(cPath,m_pcPassedToPrefsMessage,this);
		pcPrefsWin->Show();
		pcPrefsWin->MakeFocus();
	}
	
	else
		pcPrefsWin->MakeFocus();
}
开发者ID:rickcaudill,项目名称:Pyro,代码行数:18,代码来源:Camera.cpp


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