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

Vacuum
author <e085737>
date Tue, 07 Dec 2010 17:31:15 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
<e085737>
parents:
diff changeset
1 function SceneGraphIterator(){
<e085737>
parents:
diff changeset
2 }
<e085737>
parents:
diff changeset
3
<e085737>
parents:
diff changeset
4 SceneGraphIterator.prototype.set = function(list){
<e085737>
parents:
diff changeset
5 list = cur = list
<e085737>
parents:
diff changeset
6 }
<e085737>
parents:
diff changeset
7
<e085737>
parents:
diff changeset
8
<e085737>
parents:
diff changeset
9 SceneGraphIterator.prototype.hasNext = function(){
<e085737>
parents:
diff changeset
10 return (cur.next) ? 1 : 0
<e085737>
parents:
diff changeset
11 }
<e085737>
parents:
diff changeset
12
<e085737>
parents:
diff changeset
13
<e085737>
parents:
diff changeset
14
<e085737>
parents:
diff changeset
15 SceneGraphIterator.prototype.hasNext = function(id){
<e085737>
parents:
diff changeset
16 for(p in cur.next){
<e085737>
parents:
diff changeset
17 if(p.sgid == id){
<e085737>
parents:
diff changeset
18 return 1
<e085737>
parents:
diff changeset
19 }
<e085737>
parents:
diff changeset
20 }
<e085737>
parents:
diff changeset
21
<e085737>
parents:
diff changeset
22 return 0
<e085737>
parents:
diff changeset
23 }
<e085737>
parents:
diff changeset
24
<e085737>
parents:
diff changeset
25
<e085737>
parents:
diff changeset
26 SceneGraphIterator.prototype.hasNextGroup = function(id){
<e085737>
parents:
diff changeset
27 for(p in cur.next){
<e085737>
parents:
diff changeset
28 if(p.gid == id){
<e085737>
parents:
diff changeset
29 return 1
<e085737>
parents:
diff changeset
30 }
<e085737>
parents:
diff changeset
31 }
<e085737>
parents:
diff changeset
32
<e085737>
parents:
diff changeset
33 return 0
<e085737>
parents:
diff changeset
34 }
<e085737>
parents:
diff changeset
35
<e085737>
parents:
diff changeset
36
<e085737>
parents:
diff changeset
37
<e085737>
parents:
diff changeset
38 SceneGraphIterator.prototype.next = function(){
<e085737>
parents:
diff changeset
39 cur = cur.next
<e085737>
parents:
diff changeset
40 }
<e085737>
parents:
diff changeset
41
<e085737>
parents:
diff changeset
42
<e085737>
parents:
diff changeset
43
<e085737>
parents:
diff changeset
44 SceneGraphIterator.prototype.next = function(id){
<e085737>
parents:
diff changeset
45 for(p in cur.next){
<e085737>
parents:
diff changeset
46 if(p.sgid == id){
<e085737>
parents:
diff changeset
47 break
<e085737>
parents:
diff changeset
48 }
<e085737>
parents:
diff changeset
49 }
<e085737>
parents:
diff changeset
50
<e085737>
parents:
diff changeset
51 cur = p
<e085737>
parents:
diff changeset
52 }
<e085737>
parents:
diff changeset
53
<e085737>
parents:
diff changeset
54
<e085737>
parents:
diff changeset
55 SceneGraphIterator.prototype.nextGroup = function(id){
<e085737>
parents:
diff changeset
56 for(p in cur.next){
<e085737>
parents:
diff changeset
57 if(p.gid == id){
<e085737>
parents:
diff changeset
58 break
<e085737>
parents:
diff changeset
59 }
<e085737>
parents:
diff changeset
60 }
<e085737>
parents:
diff changeset
61
<e085737>
parents:
diff changeset
62 cur = p
<e085737>
parents:
diff changeset
63 }
<e085737>
parents:
diff changeset
64
<e085737>
parents:
diff changeset
65
<e085737>
parents:
diff changeset
66 SceneGraphIterator.prototype.remove = function(){
<e085737>
parents:
diff changeset
67 cur.remove()
<e085737>
parents:
diff changeset
68 }
<e085737>
parents:
diff changeset
69
<e085737>
parents:
diff changeset
70
<e085737>
parents:
diff changeset
71 SceneGraphIterator.prototype.get = function(){
<e085737>
parents:
diff changeset
72 return cur
<e085737>
parents:
diff changeset
73 }
<e085737>
parents:
diff changeset
74
<e085737>
parents:
diff changeset
75
<e085737>
parents:
diff changeset
76
<e085737>
parents:
diff changeset
77
<e085737>
parents:
diff changeset
78
<e085737>
parents:
diff changeset
79
<e085737>
parents:
diff changeset
80
<e085737>
parents:
diff changeset
81
<e085737>
parents:
diff changeset
82
<e085737>
parents:
diff changeset
83
<e085737>
parents:
diff changeset
84
<e085737>
parents:
diff changeset
85
<e085737>
parents:
diff changeset
86
<e085737>
parents:
diff changeset
87
<e085737>
parents:
diff changeset
88
<e085737>
parents:
diff changeset
89
<e085737>
parents:
diff changeset
90
<e085737>
parents:
diff changeset
91
<e085737>
parents:
diff changeset
92
<e085737>
parents:
diff changeset
93