Exemplo n.º 1
0
 @Override
 protected void childRemoved(ManagedObject child) {
   if (child instanceof SceneNodeComponent) {
     SceneNodeComponent component = (SceneNodeComponent) child;
     component.scene = null;
     _components.remove(component.baseComponentType);
     _componentBits.clear(component.componentType);
   } else {
     SceneNode node = (SceneNode) child;
     node.scene = null;
     _childNodes.remove(node);
   }
 }
Exemplo n.º 2
0
 @Override
 protected final void childAdded(ManagedObject child) {
   if (child instanceof SceneNodeComponent) {
     SceneNodeComponent component = (SceneNodeComponent) child;
     int baseType = component.baseComponentType;
     if (_components.containsKey(baseType)) {
       throw new IllegalArgumentException(
           "Node already contains component: " + component.getClass().getName());
     }
     component.scene = scene;
     _components.put(baseType, component);
     _componentBits.set(component.componentType);
   } else {
     SceneNode node = (SceneNode) child;
     node.scene = scene;
     _childNodes.add(node);
   }
 }