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