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


C++ NamedProperties::get方法代码示例

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


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

示例1: onMouseButtonDown

	//-------------------------------------------------
	void RTSCamera::onMouseButtonDown( NamedProperties& params )
	{
		int keyCode;
		vec2i mouseCoords;
		
		if( params.get( "keyCode", keyCode ) == NamedProperties::SUCCESS )
		{
			if( keyCode == GLUT_MIDDLE_BUTTON )
			{
				if( params.get( "screenCoords", mouseCoords ) == NamedProperties::SUCCESS )
					m_lastDragPos = mouseCoords;
								
				m_isDragging = true;
			}
		}
	}
开发者ID:hulcyp,项目名称:PortfolioProjects,代码行数:17,代码来源:RTSCamera.cpp

示例2: onSpecialKeyUp

	//-------------------------------------------------
	void RTSCamera::onSpecialKeyUp( NamedProperties& params )
	{
		int keyCode;
		if( params.get( "keyCode", keyCode ) == NamedProperties::SUCCESS )
		{
			m_activeSpecialKeys[ keyCode ] = false;
		}
	}
开发者ID:hulcyp,项目名称:PortfolioProjects,代码行数:9,代码来源:RTSCamera.cpp

示例3: onMouseButtonUp

	//-------------------------------------------------
	void RTSCamera::onMouseButtonUp( NamedProperties& params )
	{
		int keyCode;
		if( params.get( "keyCode", keyCode ) == NamedProperties::SUCCESS )
		{
			if( keyCode == GLUT_MIDDLE_BUTTON )
				m_isDragging = false;
		}
	}
开发者ID:hulcyp,项目名称:PortfolioProjects,代码行数:10,代码来源:RTSCamera.cpp

示例4: entityKilled

	//-------------------------------------------------------------------
	void AttackMoveOrders::entityKilled( NamedProperties& params )
	{
		Entity* entityKilled = nullptr;
		if( params.get( "entity", entityKilled ) == NamedProperties::SUCCESS )
		{
			if( entityKilled == m_currentTargetEntity )
			{
				m_currentTargetEntity = nullptr;
			}
		}
	}
开发者ID:hulcyp,项目名称:PortfolioProjects,代码行数:12,代码来源:AttackMoveOrders.cpp

示例5: shipDiedEvt

	//----------------------------------------------------------------------
	void PlayerController::shipDiedEvt( NamedProperties& params )
	{
		Spaceship* tempShip;
		if( params.get( "spaceship", tempShip ) == NamedProperties::SUCCESS )
		{
			if( tempShip == m_ship )
			{
				m_shipRespawnTimer->start();
				m_ship = nullptr;
			}
		}
	}
开发者ID:hulcyp,项目名称:GuildhallProjects,代码行数:13,代码来源:PlayerController.cpp

示例6: onMouseMove

	//-------------------------------------------------
	void RTSCamera::onMouseMove( NamedProperties& params )
	{
		vec2i mouseCoords;
		if( m_isDragging )
		{
			if( params.get( "mouseCoords", mouseCoords ) == NamedProperties::SUCCESS )
			{
				vec2i dirMouseSpace = mouseCoords - m_lastDragPos;
				vec2f dir = vec2f( (float)dirMouseSpace.x, (float)dirMouseSpace.y );
				dir.normalize();
				setPosition( getPosition() - dir );
			}
		}
	}
开发者ID:hulcyp,项目名称:PortfolioProjects,代码行数:15,代码来源:RTSCamera.cpp

示例7: onSpecialKeyDown

	//-------------------------------------------------
	void RTSCamera::onSpecialKeyDown( NamedProperties& params )
	{
		int keyCode;
		if( params.get( "keyCode", keyCode ) == NamedProperties::SUCCESS )
		{
			m_activeSpecialKeys[ keyCode ] = true;
			switch( keyCode ) 
			{
			case GLUT_KEY_LEFT:
				m_impulse.x -= 1.0f;
				break;
			case GLUT_KEY_RIGHT:
				m_impulse.x += 1.0f;
				break;
			case GLUT_KEY_UP:
				m_impulse.y += 1.0f;
				break;
			case GLUT_KEY_DOWN:
				m_impulse.y -= 1.0f;
				break;
			}
		}
	}
开发者ID:hulcyp,项目名称:PortfolioProjects,代码行数:24,代码来源:RTSCamera.cpp


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