Skip to content

Commit

Permalink
Refactoring push
Browse files Browse the repository at this point in the history
  • Loading branch information
Trainguy9512 committed Jan 30, 2025
1 parent de8645f commit dcd947b
Showing 1 changed file with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,27 @@

import com.trainguy9512.animationoverhaul.animation.data.PoseSamplerStateContainer;
import com.trainguy9512.animationoverhaul.animation.data.AnimationDriverContainer;
import org.jetbrains.annotations.NotNull;

public class PoseSampler {
public class PoseSampler implements Comparable<PoseSampler> {

private String identifier;
private int updateOrder;

protected PoseSampler(Builder<?> builder){
this.identifier = builder.identifier;
this.updateOrder = builder.updateOrder;
}

public static Builder<?> of(){
return new Builder<>();
}

@Override
public int compareTo(@NotNull PoseSampler poseSampler) {
return Integer.compare(this.updateOrder, poseSampler.updateOrder);
}

public static class Builder<B extends Builder<B>> {

private String identifier;
Expand All @@ -22,7 +31,17 @@ public static class Builder<B extends Builder<B>> {
protected Builder() {
}

public B setUpdateOrder(int)
@SuppressWarnings("unchecked")
public B setUpdateOrder(int updateOrder){
this.updateOrder = updateOrder;
return (B) this;
}

@SuppressWarnings("unchecked")
public B setIdentifier(String identifier){
this.identifier = identifier;
return (B) this;
}

public PoseSampler build(){
return new PoseSampler(this);
Expand Down

0 comments on commit dcd947b

Please sign in to comment.