2022-02-02 15:29:29 +00:00
|
|
|
|
package love.distributedrebirth.bassboonyd;
|
2022-02-01 22:33:23 +00:00
|
|
|
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.List;
|
2022-02-11 12:48:24 +00:00
|
|
|
|
import java.util.Map;
|
2022-02-01 22:33:23 +00:00
|
|
|
|
import java.util.function.Consumer;
|
2022-02-11 12:48:24 +00:00
|
|
|
|
import java.util.function.Function;
|
|
|
|
|
import java.util.stream.Collectors;
|
2022-02-01 22:33:23 +00:00
|
|
|
|
|
2022-08-24 15:33:39 +00:00
|
|
|
|
@BãßBȍőnAuthorInfoʸᴰ(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
2022-10-13 23:35:53 +00:00
|
|
|
|
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ʸᴰ(args = BãßBȍőnꝐŕḯṿª₮ḕInitArgsʸᴰ.BOON_AND_BBC)
|
|
|
|
|
private static void init(DefaultEnumSetʸᴰ<?,?> boon, BãßBȍőnCoffinOpenʸᴰ<?> BBC) {
|
|
|
|
|
BBC.UNHOLY(Ꝑŕḯṿª₮ḕ.class).PUT_GHOST(GHOST_KEY_RANG_TEL_EEN, boon.BȍőnRangTelNul() + BãßBȍőnConstantsʸᴰ.INT_ONE);
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-02-02 16:34:46 +00:00
|
|
|
|
|
2022-02-02 17:01:10 +00:00
|
|
|
|
default int BȍőnRangTelNul() {
|
2022-02-02 16:34:46 +00:00
|
|
|
|
return ordinal();
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-02 17:01:10 +00:00
|
|
|
|
default int BȍőnRangTelEen() {
|
2022-10-13 23:35:53 +00:00
|
|
|
|
return GET_BBC().UNHOLY(Ꝑŕḯṿª₮ḕ.class).GHOST_INT(Ꝑŕḯṿª₮ḕ.GHOST_KEY_RANG_TEL_EEN);
|
2022-02-02 16:34:46 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-02-02 17:01:10 +00:00
|
|
|
|
default List<T> BãßInstancesList() {
|
|
|
|
|
return Arrays.asList(BãßInstances());
|
2022-02-01 22:33:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-10-13 23:35:53 +00:00
|
|
|
|
default Map<String,T> BãßInstancesToMap(Function<T,String> keyMapper) {
|
2022-02-11 12:48:24 +00:00
|
|
|
|
return BãßInstancesList().stream().collect(Collectors.toMap(keyMapper, v -> v));
|
2022-02-01 22:33:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-02-02 17:01:10 +00:00
|
|
|
|
default T BȍőnVolgende() {
|
|
|
|
|
T[] values = BãßInstances();
|
2022-10-13 23:35:53 +00:00
|
|
|
|
int resultIndex = BãßBȍőnConstantsʸᴰ.INT_ZERO;
|
|
|
|
|
for (int i=BãßBȍőnConstantsʸᴰ.INT_ZERO;i<values.length;i++) {
|
2022-02-01 22:33:23 +00:00
|
|
|
|
if (this == values[i]) {
|
2022-10-13 23:35:53 +00:00
|
|
|
|
resultIndex = i + BãßBȍőnConstantsʸᴰ.INT_ONE;
|
2022-02-01 22:33:23 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (resultIndex == values.length) {
|
2022-10-13 23:35:53 +00:00
|
|
|
|
resultIndex = BãßBȍőnConstantsʸᴰ.INT_ZERO;
|
2022-02-01 22:33:23 +00:00
|
|
|
|
}
|
|
|
|
|
return values[resultIndex];
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-02 17:01:10 +00:00
|
|
|
|
default T BȍőnVorige() {
|
|
|
|
|
T[] values = BãßInstances();
|
2022-10-13 23:35:53 +00:00
|
|
|
|
int resultIndex = BãßBȍőnConstantsʸᴰ.INT_ZERO;
|
|
|
|
|
for (int i=BãßBȍőnConstantsʸᴰ.INT_ZERO;i<values.length;i++) {
|
2022-02-01 22:33:23 +00:00
|
|
|
|
if (this == values[i]) {
|
2022-10-13 23:35:53 +00:00
|
|
|
|
resultIndex = i - BãßBȍőnConstantsʸᴰ.INT_ONE;
|
2022-02-01 22:33:23 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-10-13 23:35:53 +00:00
|
|
|
|
if (resultIndex < BãßBȍőnConstantsʸᴰ.INT_ZERO) {
|
|
|
|
|
resultIndex = values.length - BãßBȍőnConstantsʸᴰ.INT_ONE;
|
2022-02-01 22:33:23 +00:00
|
|
|
|
}
|
|
|
|
|
return values[resultIndex];
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-02 17:55:21 +00:00
|
|
|
|
default void BãßVoorElk(Consumer<T> consumer) {
|
2022-02-02 17:01:10 +00:00
|
|
|
|
for (T value:BãßInstances()) {
|
2022-02-01 22:33:23 +00:00
|
|
|
|
consumer.accept(value);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|