MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / getItem

Method getItem

Engine/modules/Verve/Core/VDataTable.cpp:143–172  ·  view source on GitHub ↗

----------------------------------------------------------------------------- VDataTable::getItem( pIndex, *pDataItem ); Return the item with the given index. This method will return false if there is no valid data entry with that index. -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

141//
142//-----------------------------------------------------------------------------
143bool VDataTable::getItem( const S32 &pIndex, sDataItem *pDataItem )
144{
145 if ( pIndex < 0 || pIndex >= mDataMap.size() )
146 {
147 // Invalid Field.
148 return false;
149 }
150
151 S32 index = 0;
152 for ( VDataMap::Iterator itr = mDataMap.begin(); itr != mDataMap.end(); ++itr )
153 {
154 if ( index == pIndex )
155 {
156 if ( pDataItem )
157 {
158 // Store Reference.
159 *pDataItem = ( itr->value );
160 }
161
162 // Valid Field.
163 return true;
164 }
165
166 // Increment.
167 ++index;
168 }
169
170 // Invalid Field.
171 return false;
172}
173
174//-----------------------------------------------------------------------------
175//

Callers 2

clearDataMethod · 0.45
VController.cppFile · 0.45

Calls 5

sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
containsMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected