Changeset 138 in tmcsimulator-scriptbuilder for trunk/src/scriptbuilder/structures/MyScriptHandler.java
- Timestamp:
- 11/29/2017 10:06:59 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/scriptbuilder/structures/MyScriptHandler.java
r76 r138 6 6 package scriptbuilder.structures; 7 7 8 import java.awt.Color; 8 9 import java.util.ArrayList; 9 10 import java.util.Random; … … 239 240 private CadData cad = null; 240 241 242 private Color incColor = null; 243 241 244 /** 242 245 * Constructor. Initializes incident map. … … 382 385 } 383 386 } 387 else if (qName.equals(ELEMENT.COLOR.tag)) 388 { 389 incColor = new Color(Integer.parseInt(attributes.getValue("r")), 390 Integer.parseInt(attributes.getValue("g")), 391 Integer.parseInt(attributes.getValue("b"))); 392 } 384 393 else if (qName.equals(ELEMENT.FACILITATOR_EVALUATION.tag)) 385 394 { … … 458 467 { 459 468 cad = new CadData(); 469 //Nullify color 470 //This gets overwritten if color tag exists 471 incColor = null; 460 472 } 461 473 … … 732 744 } 733 745 } 746 else if (currentElement == ELEMENT.COLOR) 747 { 748 currInc.color = incColor; 749 } 734 750 else if (currentElement == ELEMENT.EXPECTED_ACTION) 735 751 { … … 887 903 if (incidentMap.get(incidentLogNumber) == null) 888 904 { 905 Color newColor = SimulationScript.incidentColors[Math.abs(new Random().nextInt()) 906 % SimulationScript.incidentColors.length]; 907 889 908 incidentMap.put(incidentLogNumber, 890 new ScriptIncident( SimulationScript.incidentColors[Math.abs(new Random().nextInt()) % SimulationScript.incidentColors.length],909 new ScriptIncident(newColor, 891 910 incidentLogNumber, currentIncName, currentIncidentDesc, 892 911 script, (int) currentEventTime)); … … 919 938 unit.Curr_Loc = pcData.remove(ELEMENT.CURR_LOC); 920 939 } 921 if (pcData.containsKey(ELEMENT.DESTINATION)) 940 if (pcData.containsKey(ELEMENT.DESTINATION)) 922 941 { 923 942 unit.Destination = pcData.remove(ELEMENT.DESTINATION);
Note: See TracChangeset
for help on using the changeset viewer.
