| 1213 | } |
| 1214 | |
| 1215 | bool 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 | |
| 1236 | SimObject* Entity::findObjectByInternalName(StringTableEntry internalName, bool searchChildren) |
| 1237 | { |
no test coverage detected