Skip to content

Commit

Permalink
Removed forceUpdateInOrder. Does that by default now
Browse files Browse the repository at this point in the history
  • Loading branch information
retrodaredevil committed Jan 3, 2020
1 parent 2a5012f commit 12385cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
12 changes: 1 addition & 11 deletions src/main/java/me/retrodaredevil/action/Actions.java
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ public T canRecycle(boolean b){
public static class ActionMultiplexerBuilder extends Builder<ActionMultiplexerBuilder>{
private final Action[] initialActions;
private boolean clearAllOnEnd = false;
private boolean updateInOrder = false;

public ActionMultiplexerBuilder(Action... initialActions){
this.initialActions = initialActions;
Expand All @@ -230,17 +229,8 @@ public ActionMultiplexerBuilder clearAllOnEnd(boolean b){
clearAllOnEnd = b;
return getThis();
}
public ActionMultiplexerBuilder forceUpdateInOrder(boolean b){
updateInOrder = b;
return getThis();
}
public ActionMultiplexer build(){
final Set<Action> actions;
if(updateInOrder){
actions = new LinkedHashSet<>(Arrays.asList(initialActions));
} else {
actions = new HashSet<>(Arrays.asList(initialActions));
}
final Set<Action> actions = new LinkedHashSet<>(Arrays.asList(initialActions));
return new SetActionMultiplexer(canRecycle, actions, canBeDone, clearAllOnEnd);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void testRemoving(){

}
@Test
void testForceOrder(){
void testOrder(){
final int[] i = {0};
final int[] value = {0};
final ActionMultiplexer multiplexer = new Actions.ActionMultiplexerBuilder(
Expand All @@ -110,7 +110,7 @@ void testForceOrder(){
assertEquals(3, i[0]++);
value[0]++;
})
).forceUpdateInOrder(true).build();
).build();
multiplexer.update();
assertEquals(4, value[0]);
}
Expand Down

0 comments on commit 12385cb

Please sign in to comment.