本文整理汇总了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;
}
}
}
示例2: onSpecialKeyUp
//-------------------------------------------------
void RTSCamera::onSpecialKeyUp( NamedProperties& params )
{
int keyCode;
if( params.get( "keyCode", keyCode ) == NamedProperties::SUCCESS )
{
m_activeSpecialKeys[ keyCode ] = false;
}
}
示例3: onMouseButtonUp
//-------------------------------------------------
void RTSCamera::onMouseButtonUp( NamedProperties& params )
{
int keyCode;
if( params.get( "keyCode", keyCode ) == NamedProperties::SUCCESS )
{
if( keyCode == GLUT_MIDDLE_BUTTON )
m_isDragging = false;
}
}
示例4: entityKilled
//-------------------------------------------------------------------
void AttackMoveOrders::entityKilled( NamedProperties& params )
{
Entity* entityKilled = nullptr;
if( params.get( "entity", entityKilled ) == NamedProperties::SUCCESS )
{
if( entityKilled == m_currentTargetEntity )
{
m_currentTargetEntity = nullptr;
}
}
}
示例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;
}
}
}
示例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 );
}
}
}
示例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;
}
}
}