Changeset 65 in tmcsimulator-scriptbuilder for trunk/src/scriptbuilder/structures


Ignore:
Timestamp:
08/24/2017 07:25:25 AM (9 years ago)
Author:
bmcguffin
Message:

Moved the "add incident" statement set into its own publicly accessible method.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/scriptbuilder/structures/SimulationScript.java

    r59 r65  
    149149            for (ScriptIncident sci : inc) 
    150150            { 
    151                 if (numberOfIncidents < INCIDENT_FILL_COUNT) 
    152                 { 
    153                     incidents.set(numberOfIncidents++, sci); 
    154                 } 
     151                addIncident(sci); 
    155152            } 
    156153        } 
     
    161158        } 
    162159        this.update(); 
     160    } 
     161 
     162    public boolean addIncident(ScriptIncident sci) 
     163    { 
     164        if (numberOfIncidents < INCIDENT_FILL_COUNT) 
     165        { 
     166            incidents.set(numberOfIncidents++, sci); 
     167            return true; 
     168        } 
     169        return false; 
    163170    } 
    164171 
Note: See TracChangeset for help on using the changeset viewer.