(File file, SourceGame game)
| 113 | } |
| 114 | |
| 115 | @Override |
| 116 | public ConvertingReport write(File file, SourceGame game) throws IOException { |
| 117 | if (!file.getParentFile() |
| 118 | .exists()) { |
| 119 | if (file.getParentFile() |
| 120 | .mkdirs()) { |
| 121 | Loggger.log("Successfully created " + file.getParentFile()); |
| 122 | } else { |
| 123 | Loggger.log("Failed to create " + file.getParentFile()); |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | ValveWriter w = new ValveWriter(file); |
| 128 | |
| 129 | Loggger.log("writing"); |
| 130 | this.writeHeader(w); |
| 131 | |
| 132 | int brushCount = 0; |
| 133 | while (this.solids.empty() == false) { |
| 134 | brushCount++; |
| 135 | this.solids.pop() |
| 136 | .writeVmf(w); |
| 137 | } |
| 138 | ConvertingReport report = new ConvertingReport(); |
| 139 | report.setBrushCount(brushCount); |
| 140 | Loggger.log(brushCount + "/8192 brushes added"); // TODO |
| 141 | w.close(); |
| 142 | this.write(this.solidEntities, w); |
| 143 | this.write(this.pointEntities, w); |
| 144 | this.writeTail(w); |
| 145 | w.finish(); |
| 146 | return report; |
| 147 | } |
| 148 | |
| 149 | private void write(Stack<? extends ValveElement> stack, ValveWriter w) throws IOException { |
| 150 | while (stack.empty() == false) { |
nothing calls this directly
no test coverage detected