MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / clone

Method clone

Engine/source/console/simObject.cpp:1317–1346  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1315//-----------------------------------------------------------------------------
1316
1317SimObject* SimObject::clone()
1318{
1319 if( !getClassRep() )
1320 return NULL;
1321
1322 ConsoleObject* conObject = getClassRep()->create();
1323 if( !conObject )
1324 return NULL;
1325
1326 SimObject* simObject = dynamic_cast< SimObject* >( conObject );
1327 if( !simObject )
1328 {
1329 delete conObject;
1330 return NULL;
1331 }
1332
1333 simObject->assignFieldsFrom( this );
1334
1335 String name = Sim::getUniqueName( getName() );
1336 if( !simObject->registerObject( name ) )
1337 {
1338 delete simObject;
1339 return NULL;
1340 }
1341
1342 if( getGroup() )
1343 getGroup()->addObject( simObject );
1344
1345 return simObject;
1346}
1347
1348//-----------------------------------------------------------------------------
1349

Callers 1

simObject.cppFile · 0.45

Calls 6

assignFieldsFromMethod · 0.80
getUniqueNameFunction · 0.70
getNameFunction · 0.50
createMethod · 0.45
registerObjectMethod · 0.45
addObjectMethod · 0.45

Tested by

no test coverage detected