Changeset 107 in tmcsimulator-scriptbuilder for trunk/src/scriptbuilder/structures/ScriptIncident.java


Ignore:
Timestamp:
09/05/2017 01:18:00 PM (9 years ago)
Author:
bmcguffin
Message:

Fixed a bug where deleting the first timeslice of an incident would not alter the reported start time of the incident.

File:
1 edited

Legend:

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

    r106 r107  
    375375        return this.number + " - " + this.name; 
    376376    } 
     377     
     378    /** 
     379     * Remove the timeslice at the given position. 
     380     *  
     381     * @param seconds absolute start time of the timeslice to remove. 
     382     */ 
     383    public void removeTimeSlice(int seconds) 
     384    { 
     385        //remove the timeslice 
     386        this.slices.remove(seconds); 
     387         
     388        //offset is equivalent to start time of earliest slice 
     389        if(seconds == offset) 
     390        { 
     391            offset = slices.firstKey(); 
     392        } 
     393        this.updateLength(); 
     394        script.update(); 
     395    } 
    377396} 
Note: See TracChangeset for help on using the changeset viewer.