Changeset 119 in tmcsimulator-scriptbuilder for trunk/src/scriptbuilder/structures/ScriptIncident.java
- Timestamp:
- 09/13/2017 12:30:19 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/scriptbuilder/structures/ScriptIncident.java
r117 r119 208 208 latestStart = start; 209 209 } 210 //If this event is earlier than all previous events, or if there are210 //If this event is earlier than all previous events, or if there are 211 211 //no other events, the offset is equal to this event's start time 212 212 if (start < offset || eventCount == 1) … … 392 392 if (seconds == offset) 393 393 { 394 offset = slices.firstKey(); 394 if (slices.size() > 0) 395 { 396 offset = slices.firstKey(); 397 } 398 else 399 { 400 offset = 0; 401 } 395 402 } 396 403 this.updateLength(); 397 404 script.update(); 398 405 } 406 407 /** 408 * Shifts the start time of a given event in this incident. The first event 409 * in the incident cannot be shifted. 410 * 411 * @param evt the event to be relocated 412 * @param oldTime the current start time of the event 413 * @param newTime the destination start time of the event 414 * @return true if the event is shifted over properly 415 * @pre the event in question exists 416 * @pre oldTime != newTime 417 */ 418 public boolean changeEventStart(I_ScriptEvent evt, int oldTime, int newTime) 419 { 420 if (!(oldTime == 0 && newTime > oldTime)) 421 { 422 this.slices.get(oldTime).events.remove(evt); 423 this.addNewEvent(evt, newTime); 424 return true; 425 } 426 return false; 427 } 399 428 }
Note: See TracChangeset
for help on using the changeset viewer.
