Sector refactoring, invasions and cleanup

This commit is contained in:
Anuken
2020-10-16 11:02:24 -04:00
parent 5ee4101ba4
commit 2f54edf34f
27 changed files with 319 additions and 376 deletions

View File

@@ -10,7 +10,7 @@ import arc.func.*;
public class IntFormat{
private final StringBuilder builder = new StringBuilder();
private final String text;
private int lastValue = Integer.MIN_VALUE;
private int lastValue = Integer.MIN_VALUE, lastValue2 = Integer.MIN_VALUE;
private Func<Integer, String> converter = String::valueOf;
public IntFormat(String text){
@@ -30,4 +30,14 @@ public class IntFormat{
lastValue = value;
return builder;
}
public CharSequence get(int value1, int value2){
if(lastValue != value1 || lastValue2 != value2){
builder.setLength(0);
builder.append(Core.bundle.format(text, value1, value2));
}
lastValue = value1;
lastValue2 = value2;
return builder;
}
}