| 78 | //----------------------------------------------------------------------------- |
| 79 | |
| 80 | void AssetQuery::onTamlCustomRead( const TamlCustomNodes& customNodes ) |
| 81 | { |
| 82 | // Call parent. |
| 83 | Parent::onTamlCustomRead( customNodes ); |
| 84 | |
| 85 | // Find custom node name. |
| 86 | const TamlCustomNode* pResultsNode = customNodes.findNode( ASSETQUERY_RESULTS_NODE_NAME ); |
| 87 | |
| 88 | // Finish if we don't have a results name. |
| 89 | if ( pResultsNode == NULL ) |
| 90 | return; |
| 91 | |
| 92 | // Fetch node name. |
| 93 | StringTableEntry assetNodeName = StringTable->insert( ASSETQUERY_ASSETNODE_NAME ); |
| 94 | |
| 95 | // Fetch children asset nodes. |
| 96 | const TamlCustomNodeVector& assetNodes = pResultsNode->getChildren(); |
| 97 | |
| 98 | // Iterate asset nodes. |
| 99 | for( TamlCustomNodeVector::const_iterator assetNodeItr = assetNodes.begin(); assetNodeItr != assetNodes.end(); ++assetNodeItr ) |
| 100 | { |
| 101 | // Fetch asset node. |
| 102 | const TamlCustomNode* pAssetNode = *assetNodeItr; |
| 103 | |
| 104 | // Skip if an unknown node name. |
| 105 | if ( pAssetNode->getNodeName() != assetNodeName ) |
| 106 | continue; |
| 107 | |
| 108 | // Fetch field. |
| 109 | const TamlCustomField* pField = pAssetNode->findField( ASSETQUERY_ASSETID_FIELD_NAME ); |
| 110 | |
| 111 | // Do we find the field? |
| 112 | if ( pField == NULL ) |
| 113 | { |
| 114 | // No, so warn. |
| 115 | Con::warnf( "AssetQuery::onTamlCustomRead() - Could not find '%s' field.", ASSETQUERY_ASSETID_FIELD_NAME ); |
| 116 | continue; |
| 117 | } |
| 118 | |
| 119 | // Store asset. |
| 120 | mAssetList.push_back(pField->getFieldValue()); |
| 121 | } |
| 122 | } |
nothing calls this directly
no test coverage detected