本文整理汇总了C++中NFCDataList::Append方法的典型用法代码示例。如果您正苦于以下问题:C++ NFCDataList::Append方法的具体用法?C++ NFCDataList::Append怎么用?C++ NFCDataList::Append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NFCDataList
的用法示例。
在下文中一共展示了NFCDataList::Append方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetValue
void NFCProperty::SetValue(const NFIDataList::TData& TData)
{
if (eType != TData.nType)
{
return;
}
if (!m_pTData.get())
{
if (!NFIDataList::Valid(TData))
{
return;
}
m_pTData = NF_SHARE_PTR<NFIDataList::TData>(NF_NEW NFIDataList::TData());
m_pTData->nType = TData.nType;
m_pTData->variantData = TData.variantData;
}
NFCDataList oldValue;
oldValue.Append(*m_pTData);
m_pTData->variantData = TData.variantData;
NFCDataList newValue;
newValue.Append(*m_pTData);
OnEventHandler(oldValue , newValue);
}
示例2: SetObject
bool NFCProperty::SetObject(const NFIDENTID& value)
{
if (eType != TDATA_OBJECT)
{
return false;
}
NFIDataList::TData TData;
TData.variantData = value;
TData.nType = TDATA_OBJECT;
if (!m_pTData.get())
{
//本身是空就是因为没数据,还来个没数据的就不存了
if (!NFIDataList::Valid(TData))
{
return false;
}
m_pTData = NF_SHARE_PTR<NFIDataList::TData>(NF_NEW NFIDataList::TData());
m_pTData->nType = TDATA_OBJECT;
m_pTData->variantData = (NFINT64)0;
}
if (TData.variantData == m_pTData->variantData)
{
return false;
}
if (TDATA_OBJECT == m_pTData->nType)
{
NFCDataList oldValue;
oldValue.Append(*m_pTData);
m_pTData->variantData = value;
NFCDataList newValue;
newValue.Append(*m_pTData);
OnEventHandler(oldValue , newValue);
return true;
}
return false;
}
示例3: SetDouble
bool NFCProperty::SetDouble(const double value)
{
if (eType != TDATA_DOUBLE)
{
return false;
}
NFIDataList::TData TData;
TData.variantData = value;
TData.nType = TDATA_DOUBLE;
if (!m_pTData.get())
{
//本身是空就是因为没数据,还来个没数据的就不存了
if (!NFIDataList::Valid(TData))
{
return false;
}
m_pTData = NF_SHARE_PTR<NFIDataList::TData>(NF_NEW NFIDataList::TData());
m_pTData->nType = TDATA_DOUBLE;
m_pTData->variantData = (double)0.0f;
}
if (TData.variantData == m_pTData->variantData)
{
return false;
}
if (TDATA_DOUBLE == m_pTData->nType)
{
NFCDataList oldValue;
oldValue.Append(*m_pTData);
m_pTData->variantData = value;
NFCDataList newValue;
newValue.Append(*m_pTData);
OnEventHandler(oldValue , newValue);
return true;
}
return false;
}
示例4: SetString
bool NFCProperty::SetString(const std::string& value)
{
if (eType != TDATA_STRING)
{
return false;
}
NFIDataList::TData TData;
TData.variantData = value;
TData.nType = TDATA_STRING;
if (!m_pTData.get())
{
//本身是空就是因为没数据,还来个没数据的就不存了
if (!NFIDataList::Valid(TData))
{
return false;
}
m_pTData = NF_SHARE_PTR<NFIDataList::TData>(NF_NEW NFIDataList::TData());
m_pTData->nType = TDATA_STRING;
m_pTData->variantData = NULL_STR;
}
if (TData.variantData == m_pTData->variantData)
{
return false;
}
if (TDATA_STRING == m_pTData->nType)
{
NFCDataList oldValue;
oldValue.Append(*m_pTData);
m_pTData->variantData = value;
NFCDataList newValue;
newValue.Append(*m_pTData);
OnEventHandler(oldValue , newValue);
return true;
}
return false;
}
示例5: OnRequireUseSkillEvent
int NFCSkillModule::OnRequireUseSkillEvent( const NFGUID& self, const int nEventID, const NFIDataList& var )
{
if ( var.GetCount() < 3)
{
return 1;
}
//EGameErrorCode errorCode = EGameErrorCode::EGEC_INVALID_SKILL;
NF_SHARE_PTR<NFIObject> pObejct = m_pKernelModule->GetObject( var.Object( 0 ) );
if ( pObejct == NULL )
{
return 1;
}
NF_SHARE_PTR<NFIRecord> pRecordSkill = pObejct->GetRecordManager()->GetElement( NFrame::Player::R_SkillTable() );
if ( pRecordSkill == NULL )
{
return 1;
}
NF_SHARE_PTR<NFIPropertyManager> pPropertyManager = m_pElementInfoModule->GetPropertyManager( var.String( 2 ) );
if ( pPropertyManager == NULL )
{
return 1;
}
NF_SHARE_PTR<NFIProperty> pItemTypeProperty = pPropertyManager->GetElement(NFrame::Skill::SkillType());
if ( pItemTypeProperty == NULL )
{
return 1;
}
//配置表中真的有这么个技能类别
EGameSkillType eItemType = ( EGameSkillType )pItemTypeProperty->GetInt();
NFISkillConsumeProcessModule* pConsumeProcessModule = m_pSkillConsumeManagerModule->GetConsumeModule( EGameSkillType::EGST_JOBSKILL_BRIEF );
if ( pConsumeProcessModule == NULL )
{
return 1;
}
NFCDataList valueOther;
valueOther.Append( var, 3, var.GetCount() - 3 ); // 被攻击玩家数量 3表示从第几个参数开始是被攻击玩家
// if ( pConsumeProcessModule->ConsumeLegal( var.ObjectVal( 0 ), var.StringVal( 2 ), valueOther ) != 0 )
// {
// return 1;
// }
//
// if ( pConsumeProcessModule->ConsumeSelf( var.ObjectVal( 0 ), var.StringVal( 2 ) ) != 0 )
// {
// return 1;
// }
//
NFCDataList damageValueList;
NFCDataList damageResultList;
int nResult = pConsumeProcessModule->ConsumeProcess( var.Object( 0 ), var.String( 2 ), valueOther, damageValueList, damageResultList );
for (int i = 0; i < valueOther.GetCount(); i++)
{
m_pKernelModule->SetPropertyInt(valueOther.Object(i), NFrame::NPC::HP(), 0);
damageValueList.AddInt(0);
damageResultList.AddInt(0);
}
//结果事件--无论失败或者是成功,都会发下去--当然使用结果只对使用者下发--成果的结果,还得对被施放的人发
if ( damageValueList.GetCount() == damageResultList.GetCount()
&& damageValueList.GetCount() == valueOther.GetCount() )
{
NFCDataList valueResult;
valueResult.AddString( var.String( 2 ).c_str() );
valueResult.AddInt( valueOther.GetCount() );
valueResult.Append( valueOther, 0, valueOther.GetCount() ); //伤害对象
valueResult.Append( damageValueList, 0, damageValueList.GetCount() ); //伤害值
valueResult.Append( damageResultList, 0, damageResultList.GetCount() ); //击打效果
//现在不需要反馈,杀了就杀了
//m_pEventProcessModule->DoEvent( pObejct->Self(), NFED_ON_CLIENT_USE_SKILL_RESULT, valueResult );
}
return 0;
}