diff Walk/resources/SceneGraphIterator.js @ 0:718974a1a32b

Vacuum
author <e085737>
date Tue, 07 Dec 2010 17:31:15 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Walk/resources/SceneGraphIterator.js	Tue Dec 07 17:31:15 2010 +0900
@@ -0,0 +1,93 @@
+function SceneGraphIterator(){
+}
+
+SceneGraphIterator.prototype.set = function(list){
+    list = cur = list
+}
+
+
+SceneGraphIterator.prototype.hasNext = function(){
+    return (cur.next) ? 1 : 0
+}
+
+
+
+SceneGraphIterator.prototype.hasNext = function(id){
+    for(p in cur.next){
+        if(p.sgid == id){
+            return 1
+	}
+    }
+
+    return 0
+}
+
+
+SceneGraphIterator.prototype.hasNextGroup = function(id){
+    for(p in cur.next){
+	if(p.gid == id){
+	    return 1
+	}
+    }
+
+    return 0
+}
+
+
+
+SceneGraphIterator.prototype.next = function(){
+    cur = cur.next
+}
+
+
+
+SceneGraphIterator.prototype.next = function(id){
+    for(p in cur.next){
+        if(p.sgid == id){
+	    break
+	}
+    }
+
+    cur = p
+}
+
+
+SceneGraphIterator.prototype.nextGroup = function(id){
+    for(p in cur.next){
+        if(p.gid == id){
+	    break
+	}
+    }
+
+    cur = p
+}
+
+
+SceneGraphIterator.prototype.remove = function(){
+    cur.remove()
+}
+
+
+SceneGraphIterator.prototype.get = function(){
+    return cur 
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+