gdxapp4d/gdxapp4d-lib-bassboonyd/src/main/java/love/distributedrebirth/bassboonyd/DefaultEnumSetʸᴰ.java

76 lines
2.3 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package love.distributedrebirth.bassboonyd;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import love.distributedrebirth.bassboonyd.info.BãßBȍőnAuthor注;
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public interface DefaultEnumSetʸᴰ<T, K extends BãßBȍőnCoffinStoreKeyʸᴰ> extends DefaultEnumBaseʸᴰ<T,K> {
public static class Ꝑŕḯṿª implements BãßBȍőnꝐŕḯṿª {
private static final String GHOST_KEY_RANG_TEL_EEN = "rangTelEen";
@BãßBȍőnꝐŕḯṿªḕInit注()
private static void init(DefaultEnumSetʸᴰ<?,?> boon) {
boon.toBBC().UNHOLY(Ꝑŕḯṿª.class).PUT_GHOST(GHOST_KEY_RANG_TEL_EEN, boon.BȍőnRangTelNul() + BãßBȍőnConstantsʸᴰ.INT_ONE);
}
}
default int BȍőnRangTelNul() {
return ordinal();
}
default int BȍőnRangTelEen() {
return toBBC().UNHOLY(Ꝑŕḯṿª.class).GHOST_INT(Ꝑŕḯṿª.GHOST_KEY_RANG_TEL_EEN);
}
default List<T> BãßInstancesList() {
return Arrays.asList(BãßInstances());
}
default Map<String,T> BãßInstancesToMap(Function<T,String> keyMapper) {
return BãßInstancesList().stream().collect(Collectors.toMap(keyMapper, v -> v));
}
default T BȍőnVolgende() {
T[] values = BãßInstances();
int resultIndex = BãßBȍőnConstantsʸᴰ.INT_ZERO;
for (int i=BãßBȍőnConstantsʸᴰ.INT_ZERO;i<values.length;i++) {
if (this == values[i]) {
resultIndex = i + BãßBȍőnConstantsʸᴰ.INT_ONE;
break;
}
}
if (resultIndex == values.length) {
resultIndex = BãßBȍőnConstantsʸᴰ.INT_ZERO;
}
return values[resultIndex];
}
default T BȍőnVorige() {
T[] values = BãßInstances();
int resultIndex = BãßBȍőnConstantsʸᴰ.INT_ZERO;
for (int i=BãßBȍőnConstantsʸᴰ.INT_ZERO;i<values.length;i++) {
if (this == values[i]) {
resultIndex = i - BãßBȍőnConstantsʸᴰ.INT_ONE;
break;
}
}
if (resultIndex < BãßBȍőnConstantsʸᴰ.INT_ZERO) {
resultIndex = values.length - BãßBȍőnConstantsʸᴰ.INT_ONE;
}
return values[resultIndex];
}
default void BãßVoorElk(Consumer<T> consumer) {
for (T value:BãßInstances()) {
consumer.accept(value);
}
}
}