void Instance::ClearAllChildren(){ for(std::vector<Instance*>::size_type i = 0; i != children.size(); i++){ Instance* kid = children[i]; if(kid != NULL){ kid->Remove(); } } }
int Instance::lua_Remove(lua_State* L){ Instance* inst = checkInstance(L, 1); if(inst){ inst->Remove(); return 0; } return luaL_error(L, COLONERR, "Remove"); }
void Instance::Remove(){ setParent(NULL); for(std::vector<Instance*>::size_type i = 0; i != children.size(); i++){ Instance* kid = children[i]; if(kid != NULL){ kid->Remove(); } } }