Save
@@ -30,6 +30,7 @@ | ||
30 | 30 | import java.util.ArrayList; |
31 | 31 | |
32 | 32 | import jp.hpl.data.EpntChunk; |
33 | +import jp.hpl.data.TermChunk; | |
33 | 34 | |
34 | 35 | public class Level { |
35 | 36 |
@@ -64,11 +65,16 @@ | ||
64 | 65 | |
65 | 66 | // added by HogePiyo |
66 | 67 | private EpntChunk epntChunk; |
67 | - | |
68 | + private TermChunk termChunk; | |
69 | + | |
68 | 70 | public Level(MapData md) { |
69 | 71 | this.md = md; |
70 | 72 | } |
71 | 73 | |
74 | + private void log(String line){ | |
75 | + System.out.print(line); | |
76 | + } | |
77 | + | |
72 | 78 | public void processChunks() { |
73 | 79 | MapWriter mw = this.md.getMapWriter(); |
74 | 80 | chunks = new ArrayList(0); |
@@ -91,7 +97,7 @@ | ||
91 | 97 | header.setLength(mw.readInt()); |
92 | 98 | header.setOffset((int)(presentOffset)); |
93 | 99 | mw.readInt(); |
94 | - System.out.print("\tChunk found: " + header.getTagString()); | |
100 | + log("\tChunk found: " + header.getTagString()); | |
95 | 101 | numChunks++; |
96 | 102 | int cTag = header.getTag(); |
97 | 103 | switch (cTag) { |
@@ -98,47 +104,47 @@ | ||
98 | 104 | case StaticFunctions.plac_CHUNK: //"plac" tag |
99 | 105 | this.placChunk = new PlacChunk(this, header); |
100 | 106 | chunks.add(placChunk); |
101 | - System.out.print("\t[X]\n"); | |
107 | + log("\t[X]\n"); | |
102 | 108 | break; |
103 | 109 | case StaticFunctions.Minf_CHUNK: //"Minf" tag |
104 | 110 | this.minfChunk = new MinfChunk(this, header); |
105 | 111 | this.chunks.add(this.minfChunk); |
106 | - System.out.print("\t[X]\n"); | |
112 | + log("\t[X]\n"); | |
107 | 113 | break; |
108 | 114 | case StaticFunctions.JUCE_CHUNK: |
109 | 115 | this.juceChunk = new JuceChunk(this, header); |
110 | 116 | this.chunks.add(this.juceChunk); |
111 | - System.out.print("\t[X]\n"); | |
117 | + log("\t[X]\n"); | |
112 | 118 | break; |
113 | 119 | case StaticFunctions.POLY_CHUNK: |
114 | 120 | this.polyChunk = new PolyChunk(this, header); |
115 | 121 | this.polyChunk.read(); |
116 | 122 | this.chunks.add(this.polyChunk); |
117 | - System.out.print("\t[X]\n"); | |
123 | + log("\t[X]\n"); | |
118 | 124 | break; |
119 | 125 | case StaticFunctions.OBJS_CHUNK: |
120 | 126 | this.objsChunk = new ObjsChunk(this, header); |
121 | 127 | this.objsChunk.read(); |
122 | 128 | this.chunks.add(this.objsChunk); |
123 | - System.out.print("\t[X]\n"); | |
129 | + log("\t[X]\n"); | |
124 | 130 | break; |
125 | 131 | case StaticFunctions.LINS_CHUNK: |
126 | 132 | this.linsChunk = new LinsChunk(this, header); |
127 | 133 | this.linsChunk.read(); |
128 | 134 | this.chunks.add(this.linsChunk); |
129 | - System.out.print("\t[X]\n"); | |
135 | + log("\t[X]\n"); | |
130 | 136 | break; |
131 | 137 | case StaticFunctions.SIDS_CHUNK: |
132 | 138 | this.sidsChunk = new SidsChunk(this, header); |
133 | 139 | this.sidsChunk.read(); |
134 | 140 | this.chunks.add(this.sidsChunk); |
135 | - System.out.print("\t[X]\n"); | |
141 | + log("\t[X]\n"); | |
136 | 142 | break; |
137 | 143 | case StaticFunctions.ShPa_CHUNK: |
138 | 144 | this.shpaChunk = new ShPaChunk(this, header); |
139 | 145 | this.shpaChunk.read(); |
140 | 146 | this.chunks.add(this.shpaChunk); |
141 | - System.out.print("\t[X]\n"); | |
147 | + log("\t[X]\n"); | |
142 | 148 | break; |
143 | 149 | |
144 | 150 | // added by HogePiyo |
@@ -146,13 +152,19 @@ | ||
146 | 152 | this.epntChunk = new EpntChunk(this, header); |
147 | 153 | this.epntChunk.read(); |
148 | 154 | this.chunks.add(this.epntChunk); |
149 | - System.out.println("\t[X]"); | |
155 | + log("\t[X]\n"); | |
150 | 156 | break; |
151 | - default: | |
152 | - System.out.print("\t[ ]\n"); | |
153 | - UnknownChunk chunk = new UnknownChunk(this, header); | |
154 | - chunks.add(chunk); | |
155 | - break; | |
157 | + | |
158 | +// case StaticFunctions.term_CHUNK: | |
159 | +// this.termChunk = new TermChunk(this, header); | |
160 | +// this.termChunk.read(); | |
161 | +// this.chunks.add(this.termChunk); | |
162 | +// break; | |
163 | + default: | |
164 | + log("\t[ ]\n"); | |
165 | + UnknownChunk chunk = new UnknownChunk(this, header); | |
166 | + chunks.add(chunk); | |
167 | + break; | |
156 | 168 | } |
157 | 169 | if (header.getNextOffset() == 0) { |
158 | 170 | break; |
@@ -167,7 +179,7 @@ | ||
167 | 179 | this.md.setOptimized(true); |
168 | 180 | } |
169 | 181 | |
170 | - System.out.println("Number of chunks: "+numChunks); | |
182 | + log("Number of chunks: "+numChunks + "\n"); | |
171 | 183 | |
172 | 184 | /* for (int z=0; z<this.chunks.size(); z++) { |
173 | 185 | boolean saveChunk = false; |
@@ -0,0 +1,32 @@ | ||
1 | +package jp.hpl.data; | |
2 | + | |
3 | +import java.util.ArrayList; | |
4 | + | |
5 | +import src.backend.Chunk; | |
6 | +import src.backend.ChunkHeader; | |
7 | +import src.backend.Level; | |
8 | + | |
9 | +public class TermChunk extends Chunk { | |
10 | + | |
11 | + public static int ENTRY_LENFTH = ; | |
12 | + | |
13 | + private ArrayList entries = new ArrayList(0); | |
14 | + private int numEntries; | |
15 | + | |
16 | + public TermChunk(Level leve, ChunkHeader header){ | |
17 | + super(leve, header); | |
18 | + } | |
19 | + public TermChunk(){ | |
20 | + super(); | |
21 | + } | |
22 | + | |
23 | + public int getEntryLength() { | |
24 | + // TODO 自動生成されたメソッド・スタブ | |
25 | + return 0; | |
26 | + } | |
27 | + | |
28 | + public int getNumEntries() { | |
29 | + return numEntries; | |
30 | + } | |
31 | + | |
32 | +} |