| 108 | } |
| 109 | |
| 110 | void Scene::addObject(SimObject* object) |
| 111 | { |
| 112 | //Child scene |
| 113 | Scene* scene = dynamic_cast<Scene*>(object); |
| 114 | if (scene) |
| 115 | { |
| 116 | //We'll keep these principly separate so they don't get saved into each other |
| 117 | mSubScenes.push_back(scene); |
| 118 | return; |
| 119 | } |
| 120 | |
| 121 | SceneObject* sceneObj = dynamic_cast<SceneObject*>(object); |
| 122 | if (sceneObj) |
| 123 | { |
| 124 | //We'll operate on the presumption that if it's being added via regular parantage means, it's considered permanent |
| 125 | mPermanentObjects.push_back(sceneObj); |
| 126 | Parent::addObject(object); |
| 127 | |
| 128 | return; |
| 129 | } |
| 130 | |
| 131 | //Do it like regular, though we should probably bail if we're trying to add non-scene objects to the scene? |
| 132 | Parent::addObject(object); |
| 133 | } |
| 134 | |
| 135 | void Scene::removeObject(SimObject* object) |
| 136 | { |
no test coverage detected