Exemplo n.º 1
0
/*virtual*/ void WBPEEldGetItem::Evaluate( const WBParamEvaluator::SPEContext& Context, WBParamEvaluator::SEvaluatedParam& EvaluatedParam ) const
{
	WBParamEvaluator::SEvaluatedParam EntityValue;
	m_EntityPE->Evaluate( Context, EntityValue );

	WBEntity* const pEntity = EntityValue.GetEntity();
	if( !pEntity )
	{
		return;
	}

	WBCompEldInventory* const pInventory = GET_WBCOMP( pEntity, EldInventory );
	if( !pInventory )
	{
		return;
	}

	WBParamEvaluator::SEvaluatedParam SlotValue;
	m_SlotPE->Evaluate( Context, SlotValue );

	ASSERT( SlotValue.m_Type == WBParamEvaluator::EPT_String );

	const HashedString	SlotHash	= SlotValue.m_String;
	WBEntity* const		pItem		= pInventory->GetItem( SlotHash );

	EvaluatedParam.m_Type	= WBParamEvaluator::EPT_Entity;
	EvaluatedParam.m_Entity	= pItem;
}
Exemplo n.º 2
0
/*virtual*/ void WBPEGetVariable::Evaluate(
    const WBParamEvaluator::SPEContext& Context,
    WBParamEvaluator::SEvaluatedParam& EvaluatedParam) const {
  WBParamEvaluator::SEvaluatedParam Value;
  m_EntityPE->Evaluate(Context, Value);

  WBEntity* const pEntity = Value.GetEntity();
  if (!pEntity) {
    return;
  }

  WBCompVariableMap* const pVariableMap = GET_WBCOMP(pEntity, VariableMap);
  if (!pVariableMap) {
    return;
  }

  const WBEvent& Variables = pVariableMap->GetVariables();
  EvaluatedParam.Set(Variables.GetParameter(m_VariableName));
}
Exemplo n.º 3
0
/*virtual*/ void WBPEEldGetSlot::Evaluate(
    const WBParamEvaluator::SPEContext& Context,
    WBParamEvaluator::SEvaluatedParam& EvaluatedParam) const {
  WBParamEvaluator::SEvaluatedParam EntityValue;
  m_EntityPE->Evaluate(Context, EntityValue);

  WBEntity* const pEntity = EntityValue.GetEntity();
  if (!pEntity) {
    return;
  }

  WBCompEldItem* const pItem = GET_WBCOMP(pEntity, EldItem);
  if (!pItem) {
    return;
  }

  const HashedString SlotHash = pItem->GetSlot();

  EvaluatedParam.m_Type = WBParamEvaluator::EPT_String;
  EvaluatedParam.m_String = ReverseHash::ReversedHash(SlotHash);
}
Exemplo n.º 4
0
/*virtual*/ void WBPEGetState::Evaluate( const WBParamEvaluator::SPEContext& Context, WBParamEvaluator::SEvaluatedParam& EvaluatedParam ) const
{
	WBParamEvaluator::SEvaluatedParam EntityValue;
	m_EntityPE->Evaluate( Context, EntityValue );

	WBEntity* const pEntity = EntityValue.GetEntity();
	if( !pEntity )
	{
		return;
	}

	WBCompState* const pState = GET_WBCOMP( pEntity, State );
	if( !pState )
	{
		return;
	}

	const SimpleString State = ReverseHash::ReversedHash( pState->GetState() );

	EvaluatedParam.m_Type	= WBParamEvaluator::EPT_String;
	EvaluatedParam.m_String	= State;
}
Exemplo n.º 5
0
/*virtual*/ void WBPEEldGetCharacterVO::Evaluate(
    const WBParamEvaluator::SPEContext& Context,
    WBParamEvaluator::SEvaluatedParam& EvaluatedParam) const {
  WBParamEvaluator::SEvaluatedParam EntityValue;
  m_EntityPE->Evaluate(Context, EntityValue);

  WBEntity* const pEntity = EntityValue.GetEntity();
  if (!pEntity) {
    return;
  }

  WBCompEldCharacter* const pCharacter = GET_WBCOMP(pEntity, EldCharacter);
  if (!pCharacter) {
    return;
  }

  const SimpleString VoiceSet = pCharacter->GetCurrentVoiceSet();
  MAKEHASH(VoiceSet);
  MAKEHASH(m_VO);

  EvaluatedParam.m_Type = WBParamEvaluator::EPT_String;
  EvaluatedParam.m_String = ConfigManager::GetString(sm_VO, "", sVoiceSet);
}