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

Method addComponent

Engine/source/T3D/entity.cpp:1215–1234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1213}
1214
1215bool Entity::addComponent(Component *comp)
1216{
1217 if (comp == NULL)
1218 return false;
1219
1220 //double-check were not re-adding anything
1221 mComponents.push_back(comp);
1222
1223 // Register the component with this owner.
1224 comp->setOwner(this);
1225
1226 //if we've already been added and this is being added after the fact(at runtime),
1227 //then just go ahead and call it's onComponentAdd so it can get to work
1228 if (mInitialized)
1229 comp->onComponentAdd();
1230
1231 onComponentAdded.trigger(comp);
1232
1233 return true;
1234}
1235
1236SimObject* Entity::findObjectByInternalName(StringTableEntry internalName, bool searchChildren)
1237{

Callers 4

entity.cppFile · 0.80
unpackUpdateMethod · 0.80

Calls 4

push_backMethod · 0.45
setOwnerMethod · 0.45
onComponentAddMethod · 0.45
triggerMethod · 0.45

Tested by

no test coverage detected