本文整理汇总了C++中NF_SHARE_PTR::GetVector3方法的典型用法代码示例。如果您正苦于以下问题:C++ NF_SHARE_PTR::GetVector3方法的具体用法?C++ NF_SHARE_PTR::GetVector3怎么用?C++ NF_SHARE_PTR::GetVector3使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NF_SHARE_PTR
的用法示例。
在下文中一共展示了NF_SHARE_PTR::GetVector3方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetElement
const NFVector3& NFCPropertyManager::GetPropertyVector3(const std::string& strPropertyName)
{
NF_SHARE_PTR<NFIProperty> pProperty = GetElement(strPropertyName);
if (pProperty)
{
return pProperty->GetVector3();
}
return NULL_VECTOR3;
}
示例2: GetElement
const NFVector3& NFCRecordManager::GetRecordVector3(const std::string& strRecordName, const int nRow, const std::string& strColTag)
{
NF_SHARE_PTR<NFIRecord> pRecord = GetElement(strRecordName);
if (pRecord)
{
return pRecord->GetVector3(nRow, strColTag);
}
return NULL_VECTOR3;
}
示例3: ConvertPropertyManagerToPB
bool NFCCreateRoleModule::ConvertPropertyManagerToPB(const NF_SHARE_PTR<NFIPropertyManager>& pProps, NFMsg::ObjectPropertyList * pPropertyData)
{
if (pProps)
{
NF_SHARE_PTR<NFIProperty> xPropert = pProps->First();
while (xPropert)
{
if (xPropert->GetCache() || xPropert->GetSave())
{
switch (xPropert->GetType())
{
case NFDATA_TYPE::TDATA_INT:
{
NFMsg::PropertyInt* pData = pPropertyData->add_property_int_list();
pData->set_property_name(xPropert->GetKey());
pData->set_data(xPropert->GetInt());
}
break;
case NFDATA_TYPE::TDATA_FLOAT:
{
NFMsg::PropertyFloat* pData = pPropertyData->add_property_float_list();
pData->set_property_name(xPropert->GetKey());
pData->set_data(xPropert->GetFloat());
}
break;
case NFDATA_TYPE::TDATA_OBJECT:
{
NFMsg::PropertyObject* pData = pPropertyData->add_property_object_list();
pData->set_property_name(xPropert->GetKey());
*(pData->mutable_data()) = NFINetModule::NFToPB(xPropert->GetObject());
}
break;
case NFDATA_TYPE::TDATA_STRING:
{
NFMsg::PropertyString* pData = pPropertyData->add_property_string_list();
pData->set_property_name(xPropert->GetKey());
pData->set_data(xPropert->GetString());
std::cout << xPropert->GetKey() << " " << xPropert->GetString() << std::endl;
}
break;
case NFDATA_TYPE::TDATA_VECTOR2:
{
NFMsg::PropertyVector2* pData = pPropertyData->add_property_vector2_list();
pData->set_property_name(xPropert->GetKey());
*(pData->mutable_data()) = NFINetModule::NFToPB(xPropert->GetVector2());
}
break;
case NFDATA_TYPE::TDATA_VECTOR3:
{
NFMsg::PropertyVector3* pData = pPropertyData->add_property_vector3_list();
pData->set_property_name(xPropert->GetKey());
*(pData->mutable_data()) = NFINetModule::NFToPB(xPropert->GetVector3());
}
break;
default:
break;
}
}
xPropert = pProps->Next();
}
}
return false;
}
示例4: ConvertRecordToPB
bool NFCCreateRoleModule::ConvertRecordToPB(const NF_SHARE_PTR<NFIRecord>& pRecord, NFMsg::ObjectRecordBase * pRecordData)
{
pRecordData->set_record_name(pRecord->GetName());
for (int iRow = 0; iRow < pRecord->GetRows(); iRow++)
{
if (!pRecord->IsUsed(iRow))
{
continue;
}
NFMsg::RecordAddRowStruct* pRowData = pRecordData->add_row_struct();
if (!pRowData)
{
continue;
}
pRowData->set_row(iRow);
for (int iCol = 0; iCol < pRecord->GetCols(); iCol++)
{
const int nType = pRecord->GetColType(iCol);
switch (nType)
{
case TDATA_INT:
{
NFMsg::RecordInt* pPropertyData = pRowData->add_record_int_list();
const NFINT64 xPropertyValue = pRecord->GetInt(iRow, iCol);
if (pPropertyData)
{
pPropertyData->set_col(iCol);
pPropertyData->set_row(iRow);
pPropertyData->set_data(xPropertyValue);
}
}
break;
case TDATA_FLOAT:
{
NFMsg::RecordFloat* pPropertyData = pRowData->add_record_float_list();
const double xPropertyValue = pRecord->GetFloat(iRow, iCol);
if (pPropertyData)
{
pPropertyData->set_col(iCol);
pPropertyData->set_row(iRow);
pPropertyData->set_data(xPropertyValue);
}
}
break;
case TDATA_STRING:
{
NFMsg::RecordString* pPropertyData = pRowData->add_record_string_list();
const std::string& xPropertyValue = pRecord->GetString(iRow, iCol);
if (pPropertyData)
{
pPropertyData->set_col(iCol);
pPropertyData->set_row(iRow);
pPropertyData->set_data(xPropertyValue);
}
}
break;
case TDATA_OBJECT:
{
NFMsg::RecordObject* pPropertyData = pRowData->add_record_object_list();
const NFGUID xPropertyValue = pRecord->GetObject(iRow, iCol);
if (pPropertyData)
{
pPropertyData->set_col(iCol);
pPropertyData->set_row(iRow);
*pPropertyData->mutable_data() = NFINetModule::NFToPB(xPropertyValue);
}
}
break;
case TDATA_VECTOR2:
{
NFMsg::RecordVector2* pPropertyData = pRowData->add_record_vector2_list();
const NFVector2 xPropertyValue = pRecord->GetVector2(iRow, iCol);
if (pPropertyData)
{
pPropertyData->set_col(iCol);
pPropertyData->set_row(iRow);
NFMsg::Vector2* pVec = pPropertyData->mutable_data();
pVec->set_x(xPropertyValue.X());
pVec->set_y(xPropertyValue.Y());
}
}
break;
case TDATA_VECTOR3:
{
NFMsg::RecordVector3* pPropertyData = pRowData->add_record_vector3_list();
const NFVector3 xPropertyValue = pRecord->GetVector3(iRow, iCol);
if (pPropertyData)
{
//.........这里部分代码省略.........