Index: trunk/src/scriptbuilder/structures/SimulationScript.java
===================================================================
--- trunk/src/scriptbuilder/structures/SimulationScript.java	(revision 131)
+++ trunk/src/scriptbuilder/structures/SimulationScript.java	(revision 145)
@@ -21,4 +21,5 @@
  *
  * @author Bryan McGuffin <bmcguffi@calpoly.edu>
+ * @author Sebastien Danthinne <sdanthin@calpoly.edu>
  * @version 2017/06/22
  */
@@ -61,8 +62,9 @@
      * The units which participate in Unit events.
      */
-    public List<Unit> units;
+    public List<Unit> units; 
 
     //Somewhere in the code, something assumes that the list of incidents
     //contains exactly 10 items. Until I can find and un-break that, this will do.
+    //todo: this incident fill count error
     private final int INCIDENT_FILL_COUNT = 10;
 
@@ -76,4 +78,6 @@
      */
     private MyScriptHandler sh;
+    
+    public boolean saved;
 
     //TODO: Pretty much everything in this constructor is dummy data.
@@ -89,4 +93,5 @@
         units = new ArrayList<Unit>();
         numberOfIncidents = 0;
+        saved = true;
 
         //Backfill with null incidents
@@ -96,15 +101,47 @@
         }
     }
-
+    
+    /**
+     * checks and sees if this object has the unit passed.
+     * @param unitID
+     * @return does this SimulationScript have unitnum?
+     */
+    public boolean hasUnit(String unitID){
+        boolean indicator = false;
+        if(units.size()!=0){
+            for(Unit u : units){
+               if(unitID.equals(u.UnitNum)){
+                   indicator = true;
+               }
+            }
+        }
+            
+        return indicator;
+    }
+    /**
+     * creates a dummy unit that only has unit number
+     * @param unitNum 
+     */
+    public void addDummyUnit(String unitNum){
+        Unit dummy = new Unit();
+        dummy.UnitNum = unitNum;
+        units.add(dummy);
+    }
     /**
      * Update the script's observers.
-     *
+     * 
      */
     public void update()
     {
         // The script has changed, notify observers
+        //use to rewrite the save indicator
+        //System.out.println("Script changed");
         setChanged();
         notifyObservers(this);
-    }
+        saved = false;
+        
+        
+    }
+    
 
     /**
@@ -154,4 +191,26 @@
         {
             System.out.println("ERROR LOADING SCRIPT");
+            ex.printStackTrace();
+        }
+        System.out.println("H");
+        for(Unit testUnit : units){
+            System.out.println(testUnit.toXML());
+        }
+        this.update();
+    }
+    
+    /**
+     * Load in an existing list of units from an XML file.
+     * @param f the file containing the units
+     */
+    public void loadUnitsFromFile(File f){
+        try
+        {
+            SAXParserFactory.newInstance().newSAXParser().parse(f, sh);
+            units.addAll(sh.getUnits());
+        }
+        catch (Exception ex)
+        {
+            System.out.println("ERROR LOADING UNITS");
             ex.printStackTrace();
         }
@@ -197,4 +256,5 @@
             ex.printStackTrace();
         }
+        saved = true;
     }
 
