Skip to content

Commit

Permalink
Add new SET option for BattleArena stat saving
Browse files Browse the repository at this point in the history
  • Loading branch information
Redned235 committed Dec 18, 2024
1 parent be2cabc commit 89561fd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public record StatInfo(ArenaStat<?> stat, StatType statType, Type type) {

public enum Type {
ADD,
REMOVE
REMOVE,
SET
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,9 @@ public void onStatChange(ArenaStatChangeEvent<?> event) {
float delta = oldValue.floatValue() - newValue.floatValue();
record.setValue(info.statType(), record.getStat(info.statType()) - delta);
}
case SET -> {
record.setValue(info.statType(), newValue.floatValue());
}
}
}
}
Expand Down

0 comments on commit 89561fd

Please sign in to comment.