Changeset 203 in tmcsimulator-scriptbuilder for trunk/src/scriptbuilder/structures/units
- Timestamp:
- 02/01/2020 04:18:21 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/scriptbuilder/structures/units/Unit.java
r145 r203 8 8 import scriptbuilder.structures.ELEMENT; 9 9 import scriptbuilder.structures.I_XML_Writable; 10 import scriptbuilder.structures.XML Writer;10 import scriptbuilder.structures.XMLBuilder; 11 11 12 12 /** … … 113 113 public String toXML() 114 114 { 115 String output = XML Writer.openTag(ELEMENT.NEW_UNIT.tag + " UnitNum=\"" + UnitNum + "\"");115 String output = XMLBuilder.openTag(ELEMENT.NEW_UNIT.tag + " UnitNum=\"" + UnitNum + "\""); 116 116 117 117 if (!ID.equals("")) 118 118 { 119 output += XML Writer.simpleTag(ID, ELEMENT.ID);119 output += XMLBuilder.simpleTag(ID, ELEMENT.ID); 120 120 } 121 121 122 122 if (!Status.equals("")) 123 123 { 124 output += XML Writer.simpleTag(Status, ELEMENT.STATUS);124 output += XMLBuilder.simpleTag(Status, ELEMENT.STATUS); 125 125 } 126 126 127 127 if (!Master_Inc_Num.equals("")) 128 128 { 129 output += XML Writer.simpleTag(Master_Inc_Num, ELEMENT.MASTER_INC_NUM);129 output += XMLBuilder.simpleTag(Master_Inc_Num, ELEMENT.MASTER_INC_NUM); 130 130 } 131 131 132 132 if (!Primary.equals("")) 133 133 { 134 output += XML Writer.simpleTag(Primary, ELEMENT.PRIMARY);134 output += XMLBuilder.simpleTag(Primary, ELEMENT.PRIMARY); 135 135 } 136 136 137 137 if (!OOS.equals("")) 138 138 { 139 output += XML Writer.simpleTag(OOS, ELEMENT.OOS);139 output += XMLBuilder.simpleTag(OOS, ELEMENT.OOS); 140 140 } 141 141 142 142 if (!Type.equals("")) 143 143 { 144 output += XML Writer.simpleTag(Type, ELEMENT.TYPE);144 output += XMLBuilder.simpleTag(Type, ELEMENT.TYPE); 145 145 } 146 146 147 147 //All units have a current location field, even if it's blank 148 output += XML Writer.simpleTag(Curr_Loc, ELEMENT.CURR_LOC);148 output += XMLBuilder.simpleTag(Curr_Loc, ELEMENT.CURR_LOC); 149 149 150 150 //All units have a destination field, even if it's blank 151 output += XML Writer.simpleTag(Destination, ELEMENT.DESTINATION);151 output += XMLBuilder.simpleTag(Destination, ELEMENT.DESTINATION); 152 152 153 153 if (!Misc_Info.equals("")) 154 154 { 155 output += XML Writer.simpleTag(Misc_Info, ELEMENT.MISC_INFO);155 output += XMLBuilder.simpleTag(Misc_Info, ELEMENT.MISC_INFO); 156 156 } 157 157 158 158 if (!Stack.equals("")) 159 159 { 160 output += XML Writer.simpleTag(Stack, ELEMENT.STACK);160 output += XMLBuilder.simpleTag(Stack, ELEMENT.STACK); 161 161 } 162 162 163 163 if (!Area.equals("")) 164 164 { 165 output += XML Writer.simpleTag(Area, ELEMENT.AREA);165 output += XMLBuilder.simpleTag(Area, ELEMENT.AREA); 166 166 } 167 167 168 168 if (!Badge_Num.equals("")) 169 169 { 170 output += XML Writer.simpleTag(Badge_Num, ELEMENT.BADGE_NUM);170 output += XMLBuilder.simpleTag(Badge_Num, ELEMENT.BADGE_NUM); 171 171 } 172 172 173 173 if (!Officer.equals("")) 174 174 { 175 output += XML Writer.simpleTag(Officer, ELEMENT.OFFICER);175 output += XMLBuilder.simpleTag(Officer, ELEMENT.OFFICER); 176 176 } 177 177 178 178 if (!Office.equals("")) 179 179 { 180 output += XML Writer.simpleTag(Office, ELEMENT.OFFICE);180 output += XMLBuilder.simpleTag(Office, ELEMENT.OFFICE); 181 181 } 182 182 183 183 if (!Timer.equals("")) 184 184 { 185 output += XML Writer.simpleTag(Timer, ELEMENT.TIMER);185 output += XMLBuilder.simpleTag(Timer, ELEMENT.TIMER); 186 186 } 187 187 188 188 if (!P.equals("")) 189 189 { 190 output += XML Writer.simpleTag(P, ELEMENT.P);190 output += XMLBuilder.simpleTag(P, ELEMENT.P); 191 191 } 192 192 193 193 if (!Agy.equals("")) 194 194 { 195 output += XML Writer.simpleTag(Agy, ELEMENT.AGY);195 output += XMLBuilder.simpleTag(Agy, ELEMENT.AGY); 196 196 } 197 197 198 198 if (!Alias.equals("")) 199 199 { 200 output += XML Writer.simpleTag(Alias, ELEMENT.ALIAS);200 output += XMLBuilder.simpleTag(Alias, ELEMENT.ALIAS); 201 201 } 202 202 203 203 if (!Unit_Status.equals("")) 204 204 { 205 output += XML Writer.simpleTag(Unit_Status, ELEMENT.UNIT_STATUS);206 } 207 208 output += XML Writer.closeTag(ELEMENT.NEW_UNIT.tag);205 output += XMLBuilder.simpleTag(Unit_Status, ELEMENT.UNIT_STATUS); 206 } 207 208 output += XMLBuilder.closeTag(ELEMENT.NEW_UNIT.tag); 209 209 return output; 210 210 }
Note: See TracChangeset
for help on using the changeset viewer.
