package love.distributedrebirth.numberxd.base2t; import java.util.Arrays; import java.util.Collections; import java.util.Map; import java.util.function.Consumer; import java.util.stream.Collectors; import love.distributedrebirth.numberxd.base2t.bone.BasePartSplit6; import love.distributedrebirth.numberxd.base2t.bone.BassBone; import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt1; import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt1Info; import love.distributedrebirth.numberxd.base2t.bone.BassBoneCoffin; import love.distributedrebirth.numberxd.base2t.bone.BassBoneName; import love.distributedrebirth.numberxd.base2t.bone.BassBoneStoreKey; /** * The distribution by 6. * * NOTE: The sexi karlson-speaker is china design 3=6 and 6=9 and in quad space, zero is the result. * * @author willemtsade ©Δ∞ 仙上主天 */ @BassBoneName("T06PartSeximal") @BassBoneAlt1Info(name="ADFGVX cipher", website="https://en.wikipedia.org/wiki/ADFGVX_cipher") public enum T06PartSeximal implements BassBone,BassBoneAlt1,BasePartSplit6 { 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"), ; public static int LENGTH() { return values().length; }; private final BassBoneCoffin bbc = BassBoneCoffin.newInstance(); private static final Map TONE_MAP = Collections.unmodifiableMap( Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v))); private static final Map CHINA_MAP = Collections.unmodifiableMap( Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getChinaKey(), v -> v))); private T06PartSeximal(String idTone, String idLetter, String chinaKey, String chinaValue, String alt1Value) { this.getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); this.getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); this.getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); this.getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); this.getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); } @Override public BassBoneCoffin getBBC() { return bbc; } public static void forEach(Consumer consumer) { for (T06PartSeximal value:values()) { consumer.accept(value); } } public static T06PartSeximal valueOfTone(String identifierTone) { return TONE_MAP.get(identifierTone); } public static T06PartSeximal valueOfChina(String chinaKey) { return CHINA_MAP.get(chinaKey); } }