Changeset 38 in tmcsimulator-scriptbuilder for trunk/src/scriptbuilder/structures/MyScriptHandler.java
- Timestamp:
- 08/03/2017 04:30:19 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/scriptbuilder/structures/MyScriptHandler.java
r37 r38 244 244 incidentMap = new TreeMap<Integer, ScriptIncident>(); 245 245 eventMap = new TreeMap<ELEMENT, I_ScriptEvent>(); 246 unitMap = new TreeMap<String, Unit>(); 246 247 pcData = new TreeMap<ELEMENT, String>(); 247 248 docPosition = new Stack<ELEMENT>(); … … 257 258 return new Vector<ScriptIncident>(incidentMap.values()); 258 259 } 260 261 /** 262 * Get the list of units that have been parsed from the script file. 263 * 264 * @returns Vector of Unit objects. 265 */ 266 public Vector<Unit> getUnits() 267 { 268 return new Vector<Unit>(unitMap.values()); 269 } 259 270 260 271 /** … … 265 276 { 266 277 //System.out.println("STUB: Start the document"); 267 for (ELEMENT e : ELEMENT.values()) 268 { 269 pcData.put(e, null); 270 } 278 271 279 } 272 280 … … 601 609 public void endElement(String uri, String localName, String qName) 602 610 { 603 604 611 currentElement = docPosition.pop(); 605 612 I_ScriptEvent newEvent = null; … … 791 798 } 792 799 793 else if ( qName.equals(ELEMENT.INCIDENT.tag))800 else if (currentElement == ELEMENT.INCIDENT) 794 801 { 795 802 currentIncName = parsedValue.toString(); … … 805 812 806 813 } 807 else if ( qName.equals(ELEMENT.NEW_UNIT))814 else if (currentElement == ELEMENT.NEW_UNIT) 808 815 { 809 816 if (unitMap.get(NewUnitNum) == null) … … 879 886 unit.Timer = pcData.remove(ELEMENT.TIMER); 880 887 } 888 unitMap.put(NewUnitNum, unit); 881 889 } 882 890 }
Note: See TracChangeset
for help on using the changeset viewer.
