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

Method onAdd

Engine/source/console/simDatablock.cpp:319–339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

317//-----------------------------------------------------------------------------
318
319bool SimDataBlock::onAdd()
320{
321 Parent::onAdd();
322
323 // This initialization is done here, and not in the constructor,
324 // because some jokers like to construct and destruct objects
325 // (without adding them to the manager) to check what class
326 // they are.
327 modifiedKey = ++sNextModifiedKey;
328 AssertFatal(sNextObjectId <= DataBlockObjectIdLast,
329 "Exceeded maximum number of data blocks");
330
331 // add DataBlock to the DataBlockGroup unless it is client side ONLY DataBlock
332 if ( !isClientOnly() )
333 if (SimGroup* grp = Sim::getDataBlockGroup())
334 grp->addObject(this);
335
336 Sim::getDataBlockSet()->addObject( this );
337
338 return true;
339}
340
341//-----------------------------------------------------------------------------
342

Callers

nothing calls this directly

Calls 2

getDataBlockGroupFunction · 0.85
addObjectMethod · 0.45

Tested by

no test coverage detected