gdxapp4d/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T06PartSeximal.java

70 lines
2.5 KiB
Java
Raw Normal View History

2022-01-30 22:00:16 +01:00
package love.distributedrebirth.numberxd.base2t;
2022-01-28 11:19:52 +01:00
import java.util.Arrays;
import java.util.Collections;
import java.util.Map;
2022-01-28 11:19:52 +01:00
import java.util.function.Consumer;
import java.util.stream.Collectors;
2022-01-28 11:19:52 +01:00
2022-01-31 01:12:29 +01:00
import love.distributedrebirth.numberxd.base2t.facet.BasePart;
2022-01-30 22:00:16 +01:00
import love.distributedrebirth.numberxd.base2t.facet.BaseFacetKey;
2022-02-01 00:26:11 +01:00
import love.distributedrebirth.numberxd.base2t.facet.BaseFacetMap;
2022-01-30 22:00:16 +01:00
import love.distributedrebirth.numberxd.base2t.facet.BasePartAlt1;
import love.distributedrebirth.numberxd.base2t.facet.BasePartSplit6;
/**
2022-01-31 13:40:01 +01:00
* The distribution by 6.
*
2022-01-30 14:50:21 +01:00
* NOTE: The sexi karlson-speaker is china design 3=6 and 6=9 and in quad space, zero is the result.
*
* @author willemtsade ©Δ 仙上主天
*/
2022-01-31 01:12:29 +01:00
public enum T06PartSeximal implements BasePart,BasePartAlt1,BasePartSplit6 {
2022-01-28 11:19:52 +01:00
2022-01-30 19:42:26 +01:00
PART_1("˦","0","","4","A"),
PART_2("˨","1","","5","D"),
PART_3("","2","","6","F"),
PART_4("","3","","7","G"),
PART_5("","4","","8","V"),
PART_6("","5","","9","X"),
2022-01-28 11:19:52 +01:00
;
2022-01-31 20:13:41 +01:00
public static int LENGTH() { return values().length; };
2022-02-01 00:26:11 +01:00
private final BaseFacetMap bfm = BaseFacetMap.newInstance();
private static final String ALT_1_NAME = "ADFGVX cipher";
private static final String ALT_1_WIKI = "https://en.wikipedia.org/wiki/ADFGVX_cipher";
private static final Map<String, T06PartSeximal> TONE_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v)));
2022-01-30 14:50:21 +01:00
private static final Map<String, T06PartSeximal> CHINA_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getChinaKey(), v -> v)));
2022-01-28 11:19:52 +01:00
private T06PartSeximal(String idTone, String idLetter, String chinaKey, String chinaValue, String alt1Value) {
2022-02-01 00:26:11 +01:00
this.getBFM().putInit(BaseFacetKey.ID_TONE, idTone);
this.getBFM().putInit(BaseFacetKey.ID_LETTER, idLetter);
this.getBFM().putInit(BaseFacetKey.CHINA_KEY, chinaKey);
this.getBFM().putInit(BaseFacetKey.CHINA_VALUE, chinaValue);
this.getBFM().putInit(BaseFacetKey.ALT_1_VALUE, alt1Value);
this.getBFM().putInit(BaseFacetKey.ALT_1_NAME, ALT_1_NAME);
this.getBFM().putInit(BaseFacetKey.ALT_1_WIKI, ALT_1_WIKI);
2022-01-30 14:50:21 +01:00
}
@Override
2022-02-01 00:26:11 +01:00
public BaseFacetMap getBFM() {
return bfm;
2022-01-28 11:19:52 +01:00
}
public static void forEach(Consumer<T06PartSeximal> consumer) {
for (T06PartSeximal value:values()) {
consumer.accept(value);
}
}
public static T06PartSeximal valueOfTone(String identifierTone) {
return TONE_MAP.get(identifierTone);
}
2022-01-30 14:50:21 +01:00
public static T06PartSeximal valueOfChina(String chinaKey) {
return CHINA_MAP.get(chinaKey);
}
2022-01-28 11:19:52 +01:00
}