-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Most of the work comes from fluddokt, see itdelatrisu/opsu#480
- Loading branch information
Showing
18 changed files
with
4,413 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package clonewith.opsu.storyboard; | ||
|
||
import java.util.List; | ||
import java.util.Set; | ||
|
||
/** | ||
* Storyboard Command Event Runner | ||
* | ||
* @author fluddokt | ||
* | ||
*/ | ||
class SBComEventRunner extends SBEventRunner{ | ||
public int start = Integer.MAX_VALUE, end = Integer.MIN_VALUE; | ||
|
||
public void addCommands(List<SBCommand> commands, Set<SBCommand> activeCommands) { | ||
for(SBCommand c : commands) { | ||
start = Math.min(start, c.startTime); | ||
end = Math.max(end, c.endTime); | ||
if(c.startTime == c.endTime || c.isSameInitalEndValue) { | ||
if(c.isVarying) //commands that vary just go to end value | ||
events.add(new EndCommandSBEvent(c.startTime, c)); | ||
else //commands that don't vary (flip/ blend) just sets it | ||
events.add(new StartCommandSBEvent(c.startTime, c)); | ||
|
||
} else if(c.isVarying){ | ||
events.add(new AttachCommandSBEvent(c.startTime, activeCommands, c)); | ||
events.add(new RemoveCommandSBEvent(c.endTime, activeCommands, c)); | ||
} else { | ||
events.add(new StartCommandSBEvent(c.startTime, c)); | ||
events.add(new EndCommandSBEvent(c.endTime, c)); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.