• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ WBEvent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中WBEvent的典型用法代码示例。如果您正苦于以下问题:C++ WBEvent类的具体用法?C++ WBEvent怎么用?C++ WBEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: if

/*virtual*/ void UIScreenEldMirror::HandleEvent( const WBEvent& Event )
{
	XTRACE_FUNCTION;

	STATIC_HASHED_STRING( SetHeadMesh );
	STATIC_HASHED_STRING( SetBodyMesh );

	const HashedString EventName = Event.GetEventName();

	if( EventName == sSetHeadMesh )
	{
		STATIC_HASHED_STRING( HeadMesh );
		const SimpleString HeadMesh = Event.GetString( sHeadMesh );

		STATIC_HASHED_STRING( HeadTexture );
		const SimpleString HeadTexture = Event.GetString( sHeadTexture );

		SetHeadMesh( HeadMesh, HeadTexture );
	}
	else if( EventName == sSetBodyMesh )
	{
		STATIC_HASHED_STRING( BodyMesh );
		const SimpleString BodyMesh = Event.GetString( sBodyMesh );

		STATIC_HASHED_STRING( BodyTexture );
		const SimpleString BodyTexture = Event.GetString( sBodyTexture );

		SetBodyMesh( BodyMesh, BodyTexture );
	}
}
开发者ID:MinorKeyGames,项目名称:Eldritch,代码行数:30,代码来源:uiscreen-eldmirror.cpp


示例2: Unused

void AnimEventEldExecuteAction::Call( Mesh* pMesh, Animation* pAnimation )
{
	Unused( pMesh );
	Unused( pAnimation );

	EldritchMesh* const	pEldritchMesh	= static_cast<EldritchMesh*>( pMesh );
	WBEntity* const		pEntity			= WBCompOwner::GetTopmostOwner( pEldritchMesh->GetEntity() );
	DEVASSERT( pEntity );

	WBEvent OnAnimEventEvent;
	STATIC_HASHED_STRING( OnAnimEvent );
	OnAnimEventEvent.SetEventName( sOnAnimEvent );
	pEntity->AddContextToEvent( OnAnimEventEvent );

	const uint NumActions = m_Actions.Size();
	for( uint ActionIndex = 0; ActionIndex < NumActions; ++ActionIndex )
	{
		WBAction* const pAction = m_Actions[ ActionIndex ];
		ASSERT( pAction );

		WBActionStack::Push( OnAnimEventEvent );
		pAction->Execute();
		WBActionStack::Pop();
	}
}
开发者ID:Johnicholas,项目名称:EldritchCopy,代码行数:25,代码来源:animeventeldexecuteaction.cpp


示例3: Wake

/*virtual*/ void WBCompEldSleeper::HandleEvent(const WBEvent& Event) {
  XTRACE_FUNCTION;

  Super::HandleEvent(Event);

  STATIC_HASHED_STRING(OnDamaged);
  STATIC_HASHED_STRING(OnAINoise);

  const HashedString EventName = Event.GetEventName();
  if (EventName == sOnDamaged) {
    Wake();
  } else if (EventName == sOnAINoise) {
    STATIC_HASHED_STRING(EventOwner);
    WBEntity* const pEventOwner = Event.GetEntity(sEventOwner);
    ASSERT(pEventOwner);

    if (pEventOwner == GetEntity()) {
      // Ignore AI noises from self (see SensorHearing for more details).
    } else {
      STATIC_HASHED_STRING(NoiseLocation);
      const Vector NoiseLocation = Event.GetVector(sNoiseLocation);

      STATIC_HASHED_STRING(NoiseRadius);
      const float NoiseRadius = Event.GetFloat(sNoiseRadius);

      HandleNoise(NoiseLocation, NoiseRadius);
    }
  }
}
开发者ID:ptitSeb,项目名称:Eldritch,代码行数:29,代码来源:wbcompeldsleeper.cpp


示例4: PublishToHUD

/*virtual*/ void WBCompEldWallet::HandleEvent(const WBEvent& Event) {
  XTRACE_FUNCTION;

  Super::HandleEvent(Event);

  STATIC_HASHED_STRING(AddMoney);
  STATIC_HASHED_STRING(RemoveMoney);
  STATIC_HASHED_STRING(OnInitialized);
  STATIC_HASHED_STRING(PushPersistence);
  STATIC_HASHED_STRING(PullPersistence);

  const HashedString EventName = Event.GetEventName();
  if (EventName == sOnInitialized) {
    PublishToHUD();
  } else if (EventName == sAddMoney) {
    STATIC_HASHED_STRING(Money);
    const uint Money = Event.GetInt(sMoney);

    STATIC_HASHED_STRING(ShowPickupScreen);
    const bool ShowPickupScreen = Event.GetBool(sShowPickupScreen);

    AddMoney(Money, ShowPickupScreen);
  } else if (EventName == sRemoveMoney) {
    STATIC_HASHED_STRING(Money);
    const uint Money = Event.GetInt(sMoney);
    RemoveMoney(Money);
  } else if (EventName == sPushPersistence) {
    PushPersistence();
  } else if (EventName == sPullPersistence) {
    PullPersistence();
  }
}
开发者ID:ptitSeb,项目名称:Eldritch,代码行数:32,代码来源:wbcompeldwallet.cpp


示例5: if

/*virtual*/ void WBCompOwner::HandleEvent( const WBEvent& Event )
{
	XTRACE_FUNCTION;

	Super::HandleEvent( Event );

	// Bit of a hack; OnEquipped is sent from Eldritch code and this lives in Workbench.
	STATIC_HASHED_STRING( OnEquipped );
	STATIC_HASHED_STRING( SetOwner );

	const HashedString EventName = Event.GetEventName();
	if( EventName == sOnEquipped )
	{
		STATIC_HASHED_STRING( Owner );
		WBEntity* const pOwner = Event.GetEntity( sOwner );
		SetOwner( pOwner );
	}
	else if( EventName == sSetOwner )
	{
		STATIC_HASHED_STRING( NewOwner );
		WBEntity* const pNewOwner = Event.GetEntity( sNewOwner );

		SetOwner( pNewOwner );
	}
}
开发者ID:MinorKeyGames,项目名称:Eldritch,代码行数:25,代码来源:wbcompowner.cpp


示例6: STATICHASH

/*virtual*/ void EldritchFramework::HandleEvent(const WBEvent& Event) {
  XTRACE_FUNCTION;

  Framework3D::HandleEvent(Event);

  STATIC_HASHED_STRING(ToggleInvertY);
  STATIC_HASHED_STRING(ToggleFullscreen);
  STATIC_HASHED_STRING(OnSliderChanged);
  STATIC_HASHED_STRING(WritePrefsConfig);
  STATIC_HASHED_STRING(CheckForUpdates);

  const HashedString EventName = Event.GetEventName();
  if (EventName == sToggleInvertY) {
    XTRACE_NAMED(ToggleInvertY);

    // TODO: Also invert controller? Or on a separate button?

    STATIC_HASHED_STRING(TurnY);
    const bool InvertY = !m_InputSystem->GetMouseInvert(sTurnY);
    m_InputSystem->SetMouseInvert(sTurnY, InvertY);
    m_InputSystem->SetControllerInvert(sTurnY, InvertY);

    // Publish config var so UI can reflect the change.
    // I could make input system publish config vars for each adjustment, but
    // that seems wasteful since most inputs currently have no adjustment.
    STATICHASH(InvertY);
    ConfigManager::SetBool(sInvertY, InvertY);
  } else if (EventName == sToggleFullscreen) {
    XTRACE_NAMED(ToggleFullscreen);
    ToggleFullscreen();
  } else if (EventName == sOnSliderChanged) {
    XTRACE_NAMED(OnSliderChanged);

    STATIC_HASHED_STRING(SliderName);
    const HashedString SliderName = Event.GetHash(sSliderName);

    STATIC_HASHED_STRING(SliderValue);
    const float SliderValue = Event.GetFloat(sSliderValue);

    HandleUISliderEvent(SliderName, SliderValue);
  } else if (EventName == sWritePrefsConfig) {
    XTRACE_NAMED(WritePrefsConfig);
    WritePrefsConfig();
  } else if (EventName == sCheckForUpdates) {
#if BUILD_WINDOWS && !BUILD_STEAM
    XTRACE_NAMED(CheckForUpdates);

    // So I can compile updating out of certain builds.
    STATICHASH(Framework);
    STATICHASH(CheckForUpdates);
    const bool CheckForUpdates =
        ConfigManager::GetBool(sCheckForUpdates, true, sFramework);
    if (CheckForUpdates) {
      m_CheckForUpdates->Check(false, true);
    }
#endif
  }
}
开发者ID:ptitSeb,项目名称:Eldritch,代码行数:58,代码来源:eldritchframework.cpp


示例7: if

/*virtual*/ void WBCompEldPickup::HandleEvent( const WBEvent& Event )
{
	XTRACE_FUNCTION;

	Super::HandleEvent( Event );

	STATIC_HASHED_STRING( OnFrobbed );
	STATIC_HASHED_STRING( OnPurchaseBuy );
	STATIC_HASHED_STRING( OnPurchaseSteal );
	STATIC_HASHED_STRING( OnShopkeeperDied );

	const HashedString EventName = Event.GetEventName();
	if( EventName == sOnShopkeeperDied )
	{
		m_Price = 0;
	}
	else if( EventName == sOnFrobbed )
	{
		STATIC_HASHED_STRING( Frobber );
		WBEntity* const pFrobber = Event.GetEntity( sFrobber );
		ASSERT( pFrobber );

		if( m_Price > 0 )
		{
			SellItemTo( pFrobber );
		}
		else
		{
			GiveItemTo( pFrobber );
		}
	}
	else if( EventName == sOnPurchaseBuy )
	{
		if( this == sm_PurchasePickup )
		{
			ASSERT( sm_Purchaser );
			AcceptPaymentFrom( sm_Purchaser );
			NotifyPurchasedBy( sm_Purchaser );
			GiveItemTo( sm_Purchaser );
		}
	}
	else if( EventName == sOnPurchaseSteal )
	{
		if( this == sm_PurchasePickup )
		{
			ASSERT( sm_Purchaser );
			NotifyTheftBy( sm_Purchaser );
			GiveItemTo( sm_Purchaser );
		}
	}
}
开发者ID:Johnicholas,项目名称:EldritchCopy,代码行数:51,代码来源:wbcompeldpickup.cpp


示例8: STATIC_HASHED_STRING

/*virtual*/ void EldritchPersistence::HandleEvent( const WBEvent& Event )
{
	STATIC_HASHED_STRING( SetPersistentVar );

	const HashedString EventName = Event.GetEventName();
	if( EventName == sSetPersistentVar )
	{
		STATIC_HASHED_STRING( Name );
		const HashedString Name = Event.GetHash( sName );

		STATIC_HASHED_STRING( Value );
		const WBEvent::SParameter* const pParameter = Event.GetParameter( sValue );
		m_VariableMap.Set( Name, pParameter );
	}
}
开发者ID:Johnicholas,项目名称:EldritchCopy,代码行数:15,代码来源:eldritchpersistence.cpp


示例9: SetState

/*virtual*/ void WBCompState::HandleEvent(const WBEvent& Event) {
  XTRACE_FUNCTION;

  Super::HandleEvent(Event);

  STATIC_HASHED_STRING(SetState);

  const HashedString EventName = Event.GetEventName();
  if (EventName == sSetState) {
    STATIC_HASHED_STRING(NewState);
    const HashedString State = Event.GetHash(sNewState);

    SetState(State);
  }
}
开发者ID:ptitSeb,项目名称:Eldritch,代码行数:15,代码来源:wbcompstate.cpp


示例10: if

/*virtual*/ void WBCompEldHard::HandleEvent( const WBEvent& Event )
{
	XTRACE_FUNCTION;

	Super::HandleEvent( Event );

	STATIC_HASHED_STRING( SetHard );
	STATIC_HASHED_STRING( PushPersistence );
	STATIC_HASHED_STRING( PullPersistence );

	const HashedString EventName = Event.GetEventName();
	if( EventName == sSetHard )
	{
		m_Hard = true;

		// Broadcast event to everything with an EldHardListener component.
		WB_MAKE_EVENT( NotifyHardModeSet, NULL );
		WB_DISPATCH_EVENT( GetEventManager(), NotifyHardModeSet, NULL );
	}
	else if( EventName == sPushPersistence )
	{
		PushPersistence();
	}
	else if( EventName == sPullPersistence )
	{
		PullPersistence();
	}
}
开发者ID:MinorKeyGames,项目名称:Eldritch,代码行数:28,代码来源:wbcompeldhard.cpp


示例11: PublishToHUD

/*virtual*/ void WBCompEldEndgameCounter::HandleEvent(const WBEvent& Event) {
  XTRACE_FUNCTION;

  Super::HandleEvent(Event);

  STATIC_HASHED_STRING(OnInitialized);
  STATIC_HASHED_STRING(IncrementEndgameCount);
  STATIC_HASHED_STRING(PushPersistence);
  STATIC_HASHED_STRING(PullPersistence);

  const HashedString EventName = Event.GetEventName();
  if (EventName == sOnInitialized) {
    if (m_Count > 0) {
      PublishToHUD();
    } else {
      SetHUDHidden(true);
    }
  } else if (EventName == sIncrementEndgameCount) {
    ++m_Count;

    PublishToHUD();
  } else if (EventName == sPushPersistence) {
    PushPersistence();
  } else if (EventName == sPullPersistence) {
    PullPersistence();
  }
}
开发者ID:ptitSeb,项目名称:Eldritch,代码行数:27,代码来源:wbcompeldendgamecounter.cpp


示例12: GetEntity

/*virtual*/ void WBCompEldRope::HandleEvent(const WBEvent& Event) {
  XTRACE_FUNCTION;

  Super::HandleEvent(Event);

  STATIC_HASHED_STRING(OnWorldChanged);
  STATIC_HASHED_STRING(OnStaticCollisionChanged);
  STATIC_HASHED_STRING(OnInitialOrientationSet);

  const HashedString EventName = Event.GetEventName();
  if (EventName == sOnWorldChanged || EventName == sOnStaticCollisionChanged) {
    if (m_Dropped) {
      // If anchor is removed, destroy the rope (and drop anyone climbing on
      // it!)

      CollisionInfo Info;
      Info.m_CollideWorld = true;
      Info.m_CollideEntities = true;
      Info.m_CollidingEntity = GetEntity();
      Info.m_UserFlags = EECF_CollideAsEntity | EECF_CollideStaticEntities;

      EldritchWorld* const pWorld = GetWorld();
      if (!pWorld->PointCheck(m_Anchor, Info)) {
        GetEntity()->Destroy();
      }
    }
  } else if (EventName == sOnInitialOrientationSet) {
    DropRope();
  }
}
开发者ID:ptitSeb,项目名称:Eldritch,代码行数:30,代码来源:wbcompeldrope.cpp


示例13: if

/*virtual*/ void WBCompEldAnchor::HandleEvent( const WBEvent& Event )
{
	XTRACE_FUNCTION;

	Super::HandleEvent( Event );

	STATIC_HASHED_STRING( OnSpawnedQueued );
	STATIC_HASHED_STRING( OnWorldChanged );
	STATIC_HASHED_STRING( OnStaticCollisionChanged );
	STATIC_HASHED_STRING( Unanchor );

	const HashedString EventName = Event.GetEventName();
	if( EventName == sOnSpawnedQueued )
	{
		SetAnchor();
	}
	else if( EventName == sOnWorldChanged || EventName == sOnStaticCollisionChanged )
	{
		if( m_IsAnchored )
		{
			CheckAnchor();
		}
	}
	else if( EventName == sUnanchor )
	{
		if( m_IsAnchored )
		{
			// Forcibly unanchor the entity
			Unanchor();
		}
	}
}
开发者ID:Johnicholas,项目名称:EldritchCopy,代码行数:32,代码来源:wbcompeldanchor.cpp


示例14: PostQuitMessage

/*virtual*/ void Framework3D::HandleEvent(const WBEvent& Event) {
  XTRACE_FUNCTION;

  STATIC_HASHED_STRING(QuitGame);
  STATIC_HASHED_STRING(ResetRenderer);
  STATIC_HASHED_STRING(ConditionalRefreshDisplay);
  STATIC_HASHED_STRING(RefreshDisplay);

  const HashedString EventName = Event.GetEventName();
  if (EventName == sQuitGame) {
#if BUILD_WINDOWS_NO_SDL
    XTRACE_NAMED(PostQuitMessage);
    PostQuitMessage(0);
#endif
#if BUILD_SDL
    SDL_Event QuitEvent;
    QuitEvent.type = SDL_QUIT;
    const int Success = SDL_PushEvent(&QuitEvent);
    ASSERT(Success);
    Unused(Success);
#endif
  } else if (EventName == sResetRenderer) {
    ResetRenderer();
  } else if (EventName == sConditionalRefreshDisplay) {
    ConditionalRefreshDisplay();
  } else if (EventName == sRefreshDisplay) {
    RefreshDisplay(m_Display->m_Fullscreen, m_Display->m_Width,
                   m_Display->m_Height);
  }
}
开发者ID:ptitSeb,项目名称:Eldritch,代码行数:30,代码来源:framework3d.cpp


示例15: if

/*virtual*/ void WBCompEldLock::HandleEvent( const WBEvent& Event )
{
	XTRACE_FUNCTION;

	Super::HandleEvent( Event );

	STATIC_HASHED_STRING( OnSpawned );
	STATIC_HASHED_STRING( Unlock );

	const HashedString EventName = Event.GetEventName();
	if( EventName == sOnSpawned )
	{
		EldritchPersistence* const pPersistence = GetGame()->GetPersistence();
		ASSERT( pPersistence );

		if( pPersistence->IsOpenLock( m_Key ) )
		{
			Unlock();
		}
	}
	else if( EventName == sUnlock )
	{
		Unlock();
	}
}
开发者ID:MinorKeyGames,项目名称:Eldritch,代码行数:25,代码来源:wbcompeldlock.cpp


示例16: if

/*virtual*/ void WBCompEldLight::HandleEvent( const WBEvent& Event )
{
	XTRACE_FUNCTION;

	Super::HandleEvent( Event );

	STATIC_HASHED_STRING( OnMoved );
	STATIC_HASHED_STRING( OnDestroyed );
	STATIC_HASHED_STRING( AddLight );
	STATIC_HASHED_STRING( RemoveLight );

	const HashedString EventName = Event.GetEventName();
	if( EventName == sOnMoved )
	{
		if( m_DeferAddLight )
		{
			// Do nothing
		}
		else
		{
			AddLight();
		}
	}
	else if( EventName == sAddLight )
	{
		AddLight();
	}
	else if( EventName == sOnDestroyed || EventName == sRemoveLight )
	{
		RemoveLight();
	}
}
开发者ID:MinorKeyGames,项目名称:Eldritch,代码行数:32,代码来源:wbcompeldlight.cpp


示例17:

/*virtual*/ void WBCompEldFaction::HandleEvent(const WBEvent& Event) {
  XTRACE_FUNCTION;

  Super::HandleEvent(Event);

  STATIC_HASHED_STRING(SetFaction);

  const HashedString EventName = Event.GetEventName();
  if (EventName == sSetFaction) {
    if (m_Immutable) {
      // Faction can't be changed, do nothing
    } else {
      STATIC_HASHED_STRING(Faction);
      m_Faction = Event.GetHash(sFaction);
    }
  }
}
开发者ID:ptitSeb,项目名称:Eldritch,代码行数:17,代码来源:wbcompeldfaction.cpp


示例18: Tick

/*virtual*/ void WBCompEldThinker::HandleEvent(const WBEvent& Event) {
  XTRACE_FUNCTION;

  WBEldritchComponent::HandleEvent(Event);

  STATIC_HASHED_STRING(TickThinkers);

  const HashedString EventName = Event.GetEventName();
  if (EventName == sTickThinkers) {
    Tick(0.0f);
  }
}
开发者ID:ptitSeb,项目名称:Eldritch,代码行数:12,代码来源:wbcompeldthinker.cpp


示例19: TryFrob

/*virtual*/ void WBCompEldFrobber::HandleEvent(const WBEvent& Event) {
  XTRACE_FUNCTION;

  Super::HandleEvent(Event);

  STATIC_HASHED_STRING(OnFrob);
  STATIC_HASHED_STRING(EnableFrob);
  STATIC_HASHED_STRING(DisableFrob);

  const HashedString EventName = Event.GetEventName();
  if (EventName == sOnFrob) {
    STATIC_HASHED_STRING(InputEdge);
    const int InputEdge = Event.GetInt(sInputEdge);

    TryFrob(InputEdge);
  } else if (EventName == sEnableFrob) {
    m_FrobDisabled = false;
  } else if (EventName == sDisableFrob) {
    m_FrobDisabled = true;
  }
}
开发者ID:ptitSeb,项目名称:Eldritch,代码行数:21,代码来源:wbcompeldfrobber.cpp


示例20:

/*virtual*/ void WBCompEldIcicles::HandleEvent( const WBEvent& Event )
{
	XTRACE_FUNCTION;

	Super::HandleEvent( Event );

	STATIC_HASHED_STRING( OnTouched );

	const HashedString EventName = Event.GetEventName();
	// TODO
	Unused( EventName );
}
开发者ID:Johnicholas,项目名称:EldritchCopy,代码行数:12,代码来源:wbcompeldicicles.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ WComboBox类代码示例发布时间:2022-05-31
下一篇:
C++ WApplication类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap