Moved interface to BaseGlyphSet

This commit is contained in:
Willem Cazander 2022-02-11 15:30:26 +01:00
parent f26163e405
commit 7fdb522e68
7 changed files with 150 additions and 139 deletions

View file

@ -53,14 +53,14 @@ public interface BãßBȍőnPartʸᴰ<T extends BãßBȍőnPartʸᴰ<T>> extends
} }
default String BȍőnPrintGlyphSetNumber10(BaseGlyphSet glyphSet) { default String BȍőnPrintGlyphSetNumber10(BaseGlyphSet glyphSet) {
return glyphSet.BȍőnPrintGlyphSetNumber10(BȍőnRangTelNul(), BãßInstances().length); return glyphSet.BȍőnPrintGlyphSetNumber10(BȍőnRangTelNul(), BãßInstances().length - 1);
} }
default String BȍőnPrintGlyphSetNumber16(BaseGlyphSet glyphSet) { default String BȍőnPrintGlyphSetNumber16(BaseGlyphSet glyphSet) {
return glyphSet.BȍőnPrintGlyphSetNumber16(BȍőnRangTelNul(), BãßInstances().length); return glyphSet.BȍőnPrintGlyphSetNumber16(BȍőnRangTelNul(), BãßInstances().length - 1);
} }
default String BȍőnPrintGlyphSetNumber36(BaseGlyphSet glyphSet) { default String BȍőnPrintGlyphSetNumber27(BaseGlyphSet glyphSet) {
return glyphSet.BȍőnPrintGlyphSetNumber36(BȍőnRangTelNul(), BãßInstances().length); return glyphSet.BȍőnPrintGlyphSetNumber27(BȍőnRangTelNul(), BãßInstances().length - 1);
} }
} }

View file

@ -1,25 +1,29 @@
package love.distributedrebirth.numberxd.glyph; package love.distributedrebirth.numberxd.glyph;
import java.text.DecimalFormat;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnClassInfoʸᴰ; import love.distributedrebirth.bassboonyd.BãßBȍőnClassInfoʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinOpenʸᴰ; import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinOpenʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinʸᴰ; import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnConstantsʸᴰ; import love.distributedrebirth.bassboonyd.BãßBȍőnConstantsʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnPackageInfoʸᴰ; import love.distributedrebirth.bassboonyd.BãßBȍőnPackageInfoʸᴰ;
import love.distributedrebirth.bassboonyd.jmx.DefaultEnumSetᴶᴹˣ;
import love.distributedrebirth.bassboonyd.jmx.GuageCounterᴶᴹˣ;
import love.distributedrebirth.numberxd.base2t.part.T10PartDecimal; import love.distributedrebirth.numberxd.base2t.part.T10PartDecimal;
import love.distributedrebirth.numberxd.base2t.part.T16PartHex; import love.distributedrebirth.numberxd.base2t.part.T16PartHex;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") @BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
@BãßBȍőnClassInfoʸᴰ(name = "BaseGlyphSet", purpose = "The encoded base scripts.") @BãßBȍőnClassInfoʸᴰ(name = "BaseGlyphSet", purpose = "The encoded base scripts.")
@BãßBȍőnPackageInfoʸᴰ(name = "love.distributedrebirth.numberxd") @BãßBȍőnPackageInfoʸᴰ(name = "love.distributedrebirth.numberxd")
public enum BaseGlyphSet implements BãßBȍőnGlyphSetʸᴰ<BaseGlyphSet> { public enum BaseGlyphSet implements DefaultEnumSetᴶᴹˣ<BaseGlyphSet,BãßBȍőnGlyphSetKeyʸᴰ> {
LATIN_BASIC(new BaseGlyphSetNumber(v -> T10PartDecimal.PART_1.BãßVoorElk(x -> v.add(Integer.toString(x.BȍőnRangTelNul())))), LATIN_BASIC(new BaseGlyphSetNumber(v -> T10PartDecimal.PART_1.BãßVoorElk(x -> v.add(Integer.toString(x.BȍőnRangTelNul())))),
new BaseGlyphSetNumber(v -> T16PartHex.PART_1.BãßVoorElk(x -> v.add(x.BȍőnAlt1Value()))), new BaseGlyphSetNumber(v -> T16PartHex.PART_1.BãßVoorElk(x -> v.add(x.BȍőnAlt1Value()))),
new BaseGlyphSetNumber("1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R")), new BaseGlyphSetNumber("1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R")),
LATIN_DTMF(new BaseGlyphSetNumber(v -> T10PartDecimal.PART_1.BãßVoorElk(x -> v.add(x.BȍőnChinaValue()))).withSeperator(BãßBȍőnConstantsʸᴰ.STR_SPACE), LATIN_DTMF(new BaseGlyphSetNumber(v -> T10PartDecimal.PART_1.BãßVoorElk(x -> v.add(x.BȍőnChinaValue()))).withSeperator(BãßBȍőnConstantsʸᴰ.STR_SPACE),
new BaseGlyphSetNumber("1","2","3","A","4","5","6","B","7","8","9","C","*","0","#","D"), new BaseGlyphSetNumber("1","2","3","A","4","5","6","B","7","8","9","C","*","0","#","D"),
LATIN_BASIC.BȍőnGlyphSetNumber36()), LATIN_BASIC.BȍőnGlyphSetNumber27()),
LATIN_TOP(new BaseGlyphSetNumber("","¹","²","³","","","","","",""), LATIN_TOP(new BaseGlyphSetNumber("","¹","²","³","","","","","",""),
new BaseGlyphSetNumber("","¹","²","³","","","","","","","","","","","",""), new BaseGlyphSetNumber("","¹","²","³","","","","","","","","","","","",""),
new BaseGlyphSetNumber("¹","²","³","","","","","","","","","","","","","","","","","","","","","","","Q","ᴿ")), new BaseGlyphSetNumber("¹","²","³","","","","","","","","","","","","","","","","","","","","","","","Q","ᴿ")),
@ -28,23 +32,23 @@ public enum BaseGlyphSet implements BãßBȍőnGlyphSetʸᴰ<BaseGlyphSet> {
new BaseGlyphSetNumber("","","","","","","","","","","","","","","բ","G","","","","","","","","","","Q","")), new BaseGlyphSetNumber("","","","","","","","","","","","","","","բ","G","","","","","","","","","","Q","")),
LATIN_TOPHEX(LATIN_BASIC.BȍőnGlyphSetNumber10(), LATIN_TOPHEX(LATIN_BASIC.BȍőnGlyphSetNumber10(),
LATIN_BASIC.BȍőnGlyphSetNumber16().withAltGlyphSet(LATIN_TOP), LATIN_BASIC.BȍőnGlyphSetNumber16().withAltGlyphSet(LATIN_TOP),
LATIN_BASIC.BȍőnGlyphSetNumber36()), LATIN_BASIC.BȍőnGlyphSetNumber27()),
TONE_SCRIPT(new BaseGlyphSetNumber(v -> T10PartDecimal.PART_1.BãßVoorElk(x -> v.add(x.BȍőnDialTone()))), TONE_SCRIPT(new BaseGlyphSetNumber(v -> T10PartDecimal.PART_1.BãßVoorElk(x -> v.add(x.BȍőnDialTone()))),
new BaseGlyphSetNumber(v -> T16PartHex.PART_1.BãßVoorElk(x -> v.add(x.BȍőnDialTone()))), new BaseGlyphSetNumber(v -> T16PartHex.PART_1.BãßVoorElk(x -> v.add(x.BȍőnDialTone()))),
new BaseGlyphSetNumber("꜊꜈","꜊꜉","꜊꜋","꜊꜌","꜊꜍","꜊꜎","꜊꜏","꜊꜐","꜊꜑","˧˥","˧˦","˧˨","˧˩","˧꜒","˧꜓","˧꜔","˧꜕","˧꜖","꜏˥","꜏˦","꜏˧","꜏˨","꜏˩","꜏꜍","꜏꜎","꜏꜐","꜏꜑")), new BaseGlyphSetNumber("꜊꜈","꜊꜉","꜊꜋","꜊꜌","꜊꜍","꜊꜎","꜊꜏","꜊꜐","꜊꜑","˧˥","˧˦","˧˨","˧˩","˧꜒","˧꜓","˧꜔","˧꜕","˧꜖","꜏˥","꜏˦","꜏˧","꜏˨","꜏˩","꜏꜍","꜏꜎","꜏꜐","꜏꜑")),
DIPAVALI_LRPATH_TOPHEX(new BaseGlyphSetNumber(v -> T10PartDecimal.PART_1.BãßVoorElk(x -> v.add(x.BȍőnAlt1Value()))), DIPAVALI_LRPATH_TOPHEX(new BaseGlyphSetNumber(v -> T10PartDecimal.PART_1.BãßVoorElk(x -> v.add(x.BȍőnAlt1Value()))),
new BaseGlyphSetNumber("˧˥˩","˧˩˥","˧˥˦","˧˩˨","˧˦˦","˧˨˨","˧˥˥","˧˩˩","˥˩˧","˩˥˧","˥˦˧","˩˨˧","˦˦˧","˨˨˧","˥˥˧","˩˩˧").withAltGlyphSet(BaseGlyphSet.LATIN_TOP), new BaseGlyphSetNumber("˧˥˩","˧˩˥","˧˥˦","˧˩˨","˧˦˦","˧˨˨","˧˥˥","˧˩˩","˥˩˧","˩˥˧","˥˦˧","˩˨˧","˦˦˧","˨˨˧","˥˥˧","˩˩˧").withAltGlyphSet(BaseGlyphSet.LATIN_TOP),
TONE_SCRIPT.BȍőnGlyphSetNumber36()), TONE_SCRIPT.BȍőnGlyphSetNumber27()),
DIPAVALI_LRPATH_SUBHEX(new BaseGlyphSetNumber(v -> T10PartDecimal.PART_1.BãßVoorElk(x -> v.add(x.BȍőnAlt1Value()))), DIPAVALI_LRPATH_SUBHEX(new BaseGlyphSetNumber(v -> T10PartDecimal.PART_1.BãßVoorElk(x -> v.add(x.BȍőnAlt1Value()))),
new BaseGlyphSetNumber("˧˥˩","˧˩˥","˧˥˦","˧˩˨","˧˦˦","˧˨˨","˧˥˥","˧˩˩","˥˩˧","˩˥˧","˥˦˧","˩˨˧","˦˦˧","˨˨˧","˥˥˧","˩˩˧").withAltGlyphSet(BaseGlyphSet.LATIN_SUB), new BaseGlyphSetNumber("˧˥˩","˧˩˥","˧˥˦","˧˩˨","˧˦˦","˧˨˨","˧˥˥","˧˩˩","˥˩˧","˩˥˧","˥˦˧","˩˨˧","˦˦˧","˨˨˧","˥˥˧","˩˩˧").withAltGlyphSet(BaseGlyphSet.LATIN_SUB),
TONE_SCRIPT.BȍőnGlyphSetNumber36()), TONE_SCRIPT.BȍőnGlyphSetNumber27()),
DIPAVALI_RLPATH_TOPHEX(new BaseGlyphSetNumber(v -> T10PartDecimal.PART_1.BãßVoorElk(x -> v.add(x.BȍőnAlt2Value()))), DIPAVALI_RLPATH_TOPHEX(new BaseGlyphSetNumber(v -> T10PartDecimal.PART_1.BãßVoorElk(x -> v.add(x.BȍőnAlt2Value()))),
new BaseGlyphSetNumber("꜔꜒꜖","꜔꜖꜒","꜔꜒꜓","꜔꜖꜕","꜔꜓꜓","꜔꜕꜕","꜔꜒꜒","꜔꜖꜖","꜒꜖꜔","꜖꜒꜔","꜒꜓꜔","꜖꜕꜔","꜓꜓꜔","꜕꜕꜔","꜒꜒꜔","꜖꜖꜔").withAltGlyphSet(BaseGlyphSet.LATIN_TOP), new BaseGlyphSetNumber("꜔꜒꜖","꜔꜖꜒","꜔꜒꜓","꜔꜖꜕","꜔꜓꜓","꜔꜕꜕","꜔꜒꜒","꜔꜖꜖","꜒꜖꜔","꜖꜒꜔","꜒꜓꜔","꜖꜕꜔","꜓꜓꜔","꜕꜕꜔","꜒꜒꜔","꜖꜖꜔").withAltGlyphSet(BaseGlyphSet.LATIN_TOP),
TONE_SCRIPT.BȍőnGlyphSetNumber36()), TONE_SCRIPT.BȍőnGlyphSetNumber27()),
DIPAVALI_RLPATH_SUBHEX(new BaseGlyphSetNumber(v -> T10PartDecimal.PART_1.BãßVoorElk(x -> v.add(x.BȍőnAlt2Value()))), DIPAVALI_RLPATH_SUBHEX(new BaseGlyphSetNumber(v -> T10PartDecimal.PART_1.BãßVoorElk(x -> v.add(x.BȍőnAlt2Value()))),
new BaseGlyphSetNumber("꜔꜒꜖","꜔꜖꜒","꜔꜒꜓","꜔꜖꜕","꜔꜓꜓","꜔꜕꜕","꜔꜒꜒","꜔꜖꜖","꜒꜖꜔","꜖꜒꜔","꜒꜓꜔","꜖꜕꜔","꜓꜓꜔","꜕꜕꜔","꜒꜒꜔","꜖꜖꜔").withAltGlyphSet(BaseGlyphSet.LATIN_SUB), new BaseGlyphSetNumber("꜔꜒꜖","꜔꜖꜒","꜔꜒꜓","꜔꜖꜕","꜔꜓꜓","꜔꜕꜕","꜔꜒꜒","꜔꜖꜖","꜒꜖꜔","꜖꜒꜔","꜒꜓꜔","꜖꜕꜔","꜓꜓꜔","꜕꜕꜔","꜒꜒꜔","꜖꜖꜔").withAltGlyphSet(BaseGlyphSet.LATIN_SUB),
TONE_SCRIPT.BȍőnGlyphSetNumber36()), TONE_SCRIPT.BȍőnGlyphSetNumber27()),
GREEK(new BaseGlyphSetNumber("ō","α","β","γ","δ","ε","ϝ","ζ","η","θ"), GREEK(new BaseGlyphSetNumber("ō","α","β","γ","δ","ε","ϝ","ζ","η","θ"),
new BaseGlyphSetNumber("ō","α","β","γ","δ","ε","ϝ","ζ","η","θ","ι","κ","λ","μ","ν","ξ"), new BaseGlyphSetNumber("ō","α","β","γ","δ","ε","ϝ","ζ","η","θ","ι","κ","λ","μ","ν","ξ"),
@ -61,13 +65,13 @@ public enum BaseGlyphSet implements BãßBȍőnGlyphSetʸᴰ<BaseGlyphSet> {
new BaseGlyphSetNumber("","","","","","","","","","","","","","","","","","","","","","","","","","","")), new BaseGlyphSetNumber("","","","","","","","","","","","","","","","","","","","","","","","","","","")),
RUNIC_TOPHEX(RUNIC.BȍőnGlyphSetNumber10(), RUNIC_TOPHEX(RUNIC.BȍőnGlyphSetNumber10(),
RUNIC.BȍőnGlyphSetNumber16().withAltGlyphSet(LATIN_TOP), RUNIC.BȍőnGlyphSetNumber16().withAltGlyphSet(LATIN_TOP),
RUNIC.BȍőnGlyphSetNumber36()), RUNIC.BȍőnGlyphSetNumber27()),
KOREAN(new BaseGlyphSetNumber("","","","","","","","","",""), KOREAN(new BaseGlyphSetNumber("","","","","","","","","",""),
new BaseGlyphSetNumber("","","","","","","","","","","","","","","",""), new BaseGlyphSetNumber("","","","","","","","","","","","","","","",""),
new BaseGlyphSetNumber("","","","","","","","","","","","","","","","","","","","","","","","","","","")), new BaseGlyphSetNumber("","","","","","","","","","","","","","","","","","","","","","","","","","","")),
KOREAN_TOPHEX(KOREAN.BȍőnGlyphSetNumber10(), KOREAN_TOPHEX(KOREAN.BȍőnGlyphSetNumber10(),
KOREAN.BȍőnGlyphSetNumber16().withAltGlyphSet(LATIN_TOP), KOREAN.BȍőnGlyphSetNumber16().withAltGlyphSet(LATIN_TOP),
KOREAN.BȍőnGlyphSetNumber36()), KOREAN.BȍőnGlyphSetNumber27()),
CHINA( CHINA(
new BaseGlyphSetNumber("","","","","","","","","",""), LATIN_BASIC.BȍőnGlyphSetNumber16(), null), new BaseGlyphSetNumber("","","","","","","","","",""), LATIN_BASIC.BȍőnGlyphSetNumber16(), null),
@ -85,12 +89,17 @@ public enum BaseGlyphSet implements BãßBȍőnGlyphSetʸᴰ<BaseGlyphSet> {
new BaseGlyphSetNumber("А","В","Г","Д","Є","Ѕ","З","И","Ѳ","І","К","Л","М","Н","Ѯ","Ѻ","П","Ч","Р","С","Т","Ѵ","Ф","Х","Ѱ","Ѿ","Ц")), new BaseGlyphSetNumber("А","В","Г","Д","Є","Ѕ","З","И","Ѳ","І","К","Л","М","Н","Ѯ","Ѻ","П","Ч","Р","С","Т","Ѵ","Ф","Х","Ѱ","Ѿ","Ц")),
ARABIC(new BaseGlyphSetNumber("٠","١","٢","٣","٤","٥","٦","٧","٨","٩"), ARABIC(new BaseGlyphSetNumber("٠","١","٢","٣","٤","٥","٦","٧","٨","٩"),
LATIN_BASIC.BȍőnGlyphSetNumber16(), LATIN_BASIC.BȍőnGlyphSetNumber16(),
new BaseGlyphSetNumber("ا","ب","ج","د","ه","و","ز","ح","ط","ي","ك","ل","م","ن","س","ع","ف","ص","ق","ر","ش","ت","ث","خ","ذ","ض","ظ")), new BaseGlyphSetNumber("ا","ب","ج","د","ه","و","ز","ح","ط","ي","ك","ل","م","ن","س","ع","ف","ص","ق","ر","ش","ت","ث","خ","ذ","ض","ظ"),
true),
HEBREW(new BaseGlyphSetNumber("אֶפֶס","אֶחָד","שְׁתַּיִם","שְׁלֹשָׁה","אַרְבַּע‎","חֲמִשָּׁה‎","שֵׁשׁ‎","שִׁבְעָה","שְׁמוֹנֶה","תִּשְׁעָה‎").withSeperator(BãßBȍőnConstantsʸᴰ.STR_SPACE), HEBREW(new BaseGlyphSetNumber("אֶפֶס","אֶחָד","שְׁתַּיִם","שְׁלֹשָׁה","אַרְבַּע‎","חֲמִשָּׁה‎","שֵׁשׁ‎","שִׁבְעָה","שְׁמוֹנֶה","תִּשְׁעָה‎").withSeperator(BãßBȍőnConstantsʸᴰ.STR_SPACE),
LATIN_BASIC.BȍőnGlyphSetNumber16(), LATIN_BASIC.BȍőnGlyphSetNumber16(),
new BaseGlyphSetNumber("א","ב","ג","ד","ה","ו","ז","ח","ט","י","כ","ל","מ","נ","ס ","ע","פ","צ","ק","ר","ש","ת","ך","ם","ן","ף","ץ")), new BaseGlyphSetNumber("א","ב","ג","ד","ה","ו","ז","ח","ט","י","כ","ל","מ","נ","ס ","ע","פ","צ","ק","ר","ש","ת","ך","ם","ן","ף","ץ"),
true),
; ;
private final GuageCounterᴶᴹˣ printsGlyphSetNumber10;
private final GuageCounterᴶᴹˣ printsGlyphSetNumber16;
private final GuageCounterᴶᴹˣ printsGlyphSetNumber27;
private final BãßBȍőnCoffinOpenʸᴰ<BãßBȍőnGlyphSetKeyʸᴰ> BBC = BãßBȍőnCoffinOpenʸᴰ.newInstance(); private final BãßBȍőnCoffinOpenʸᴰ<BãßBȍőnGlyphSetKeyʸᴰ> BBC = BãßBȍőnCoffinOpenʸᴰ.newInstance();
public BãßBȍőnCoffinʸᴰ<BãßBȍőnGlyphSetKeyʸᴰ> GET_BBC() { return BBC; } public BãßBȍőnCoffinʸᴰ<BãßBȍőnGlyphSetKeyʸᴰ> GET_BBC() { return BBC; }
public static int LENGTH() { return values().length; }; public static int LENGTH() { return values().length; };
@ -100,11 +109,35 @@ public enum BaseGlyphSet implements BãßBȍőnGlyphSetʸᴰ<BaseGlyphSet> {
} }
private BaseGlyphSet(BaseGlyphSetNumber numbers, BaseGlyphSetNumber hex, BaseGlyphSetNumber gematria) { private BaseGlyphSet(BaseGlyphSetNumber numbers, BaseGlyphSetNumber hex, BaseGlyphSetNumber gematria) {
this(numbers, hex, gematria, false);
}
private BaseGlyphSet(BaseGlyphSetNumber numbers, BaseGlyphSetNumber hex, BaseGlyphSetNumber gematria, Boolean reverseScript) {
BBC.PUT_OBJ(BãßBȍőnGlyphSetKeyʸᴰ.NUMBERS, numbers); BBC.PUT_OBJ(BãßBȍőnGlyphSetKeyʸᴰ.NUMBERS, numbers);
BBC.PUT_OBJ(BãßBȍőnGlyphSetKeyʸᴰ.HEXIMALS, hex); BBC.PUT_OBJ(BãßBȍőnGlyphSetKeyʸᴰ.HEXIMALS, hex);
BBC.PUT_OBJ(BãßBȍőnGlyphSetKeyʸᴰ.GEMATRIA, gematria); BBC.PUT_OBJ(BãßBȍőnGlyphSetKeyʸᴰ.GEMATRIA, gematria);
BBC.PUT_OBJ(BãßBȍőnGlyphSetKeyʸᴰ.REVERSE_SCRIPT, reverseScript); // TODO: ImGui workaround
BBC.BOON_INIT(this); BBC.BOON_INIT(this);
this.BȍőnJmxInit(BãßBȍőnGlyphSetKeyʸᴰ.JMX); this.BȍőnJmxInit(BãßBȍőnGlyphSetKeyʸᴰ.JMX);
printsGlyphSetNumber10 = BȍőnJmxInitGuageCounter(BãßBȍőnGlyphSetKeyʸᴰ.JMX, "printsGlyphSetNumber10");
printsGlyphSetNumber16 = BȍőnJmxInitGuageCounter(BãßBȍőnGlyphSetKeyʸᴰ.JMX, "printsGlyphSetNumber16");
printsGlyphSetNumber27 = BȍőnJmxInitGuageCounter(BãßBȍőnGlyphSetKeyʸᴰ.JMX, "printsGlyphSetNumber27");
}
public BaseGlyphSetNumber BȍőnGlyphSetNumber10() {
return GET_BBC().GET_OBJ(BãßBȍőnGlyphSetKeyʸᴰ.NUMBERS, BaseGlyphSetNumber.class);
}
public BaseGlyphSetNumber BȍőnGlyphSetNumber16() {
return GET_BBC().GET_OBJ(BãßBȍőnGlyphSetKeyʸᴰ.HEXIMALS, BaseGlyphSetNumber.class);
}
public BaseGlyphSetNumber BȍőnGlyphSetNumber27() {
return GET_BBC().GET_OBJ(BãßBȍőnGlyphSetKeyʸᴰ.GEMATRIA, BaseGlyphSetNumber.class);
}
public Boolean BȍőnGlyphSetReverseScript() {
return GET_BBC().GET_BOOL(BãßBȍőnGlyphSetKeyʸᴰ.REVERSE_SCRIPT);
} }
public String BȍőnConvertTo(String numbers) { public String BȍőnConvertTo(String numbers) {
@ -119,4 +152,95 @@ public enum BaseGlyphSet implements BãßBȍőnGlyphSetʸᴰ<BaseGlyphSet> {
} }
return buf.toString(); return buf.toString();
} }
public String BȍőnPrintGlyphSetNumber10(int number, int numberMax) {
printsGlyphSetNumber10.increment();
String maxDigitNumber = Integer.toString(numberMax);
StringBuilder maxDigitFormat = new StringBuilder();
for (int i=0;i<maxDigitNumber.length();i++) {
maxDigitFormat.append("0");
}
String numberStr = new DecimalFormat(maxDigitFormat.toString()).format(number);
StringBuilder buf = new StringBuilder();
for (int i=0;i<numberStr.length();i++) {
char c = numberStr.charAt(i);
int numberDigit = c - '0';
buf.append(BȍőnGlyphSetNumber10().BȍőnCharFor(numberDigit));
if (i<numberStr.length() - 1) {
buf.append(BȍőnGlyphSetNumber10().BȍőnCharSeperator());
}
}
if (BȍőnGlyphSetReverseScript()) {
return buf.reverse().toString();
}
return buf.toString();
}
public String BȍőnPrintGlyphSetNumber16(int number, int numberMax) {
printsGlyphSetNumber16.increment();
String maxDigitNumber = Integer.toHexString(numberMax);
String numberStr = Integer.toHexString(number);
StringBuilder buf = new StringBuilder();
BaseGlyphSet printSet = this;
for (int i=numberStr.length();i<maxDigitNumber.length();i++) {
buf.append(printSet.BȍőnGlyphSetNumber16().BȍőnCharFor(0));
if (i==numberStr.length() && BȍőnGlyphSetNumber16().BȍőnAltGlyphSet() != null) {
printSet = BȍőnGlyphSetNumber16().BȍőnAltGlyphSet();
}
}
for (int i=0;i<numberStr.length();i++) {
char c = numberStr.charAt(i);
int numberDigit = 0;
if (c >= 'a') {
numberDigit = c - 'a' + 10;
} else {
numberDigit = c - '0';
}
buf.append(printSet.BȍőnGlyphSetNumber16().BȍőnCharFor(numberDigit));
if (i<numberStr.length() - 1) {
buf.append(printSet.BȍőnGlyphSetNumber16().BȍőnCharSeperator());
}
if (i==0 && BȍőnGlyphSetNumber16().BȍőnAltGlyphSet() != null) {
printSet = BȍőnGlyphSetNumber16().BȍőnAltGlyphSet();
}
}
if (BȍőnGlyphSetReverseScript()) {
return buf.reverse().toString();
}
return buf.toString();
}
public String BȍőnPrintGlyphSetNumber27(int number, int numberMax) {
printsGlyphSetNumber27.increment();
String maxDigitNumber = Integer.toString(numberMax, 27);
String numberStr = Integer.toString(number, 27);
StringBuilder buf = new StringBuilder();
BaseGlyphSet printSet = this;
for (int i=numberStr.length();i<maxDigitNumber.length();i++) {
buf.append(printSet.BȍőnGlyphSetNumber27().BȍőnCharFor(0));
if (i==numberStr.length() && BȍőnGlyphSetNumber27().BȍőnAltGlyphSet() != null) {
printSet = BȍőnGlyphSetNumber27().BȍőnAltGlyphSet();
}
}
for (int i=0;i<numberStr.length();i++) {
char c = numberStr.charAt(i);
int numberDigit = 0;
if (c >= 'a') {
numberDigit = c - 'a' + 10;
} else {
numberDigit = c - '0';
}
buf.append(printSet.BȍőnGlyphSetNumber27().BȍőnCharFor(numberDigit));
if (i<numberStr.length() - 1) {
buf.append(printSet.BȍőnGlyphSetNumber27().BȍőnCharSeperator());
}
if (i==0 && BȍőnGlyphSetNumber27().BȍőnAltGlyphSet() != null) {
printSet = BȍőnGlyphSetNumber27().BȍőnAltGlyphSet();
}
}
if (BȍőnGlyphSetReverseScript()) {
return buf.reverse().toString(); // TODO: ImGui workaround
}
return buf.toString();
}
} }

View file

@ -126,7 +126,7 @@ public final class BaseGlyphSetNumber {
return altGlyphSet; return altGlyphSet;
} }
public String BȍőnCharFor36(int number) { public String BȍőnCharFor27(int number) {
switch (number) { switch (number) {
case 1: case 1:
return chars.get(0); return chars.get(0);

View file

@ -11,5 +11,6 @@ public enum BãßBȍőnGlyphSetKeyʸᴰ implements BãßBȍőnCoffinStoreKeyʸ
NUMBERS, NUMBERS,
GEMATRIA, GEMATRIA,
HEXIMALS, HEXIMALS,
REVERSE_SCRIPT
; ;
} }

View file

@ -1,116 +0,0 @@
package love.distributedrebirth.numberxd.glyph;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.bassboonyd.jmx.DefaultEnumSetᴶᴹˣ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public interface BãßBȍőnGlyphSetʸᴰ<T extends BãßBȍőnGlyphSetʸᴰ<T>> extends DefaultEnumSetᴶᴹˣ<T,BãßBȍőnGlyphSetKeyʸᴰ> {
default BaseGlyphSetNumber BȍőnGlyphSetNumber10() {
return GET_BBC().GET_OBJ(BãßBȍőnGlyphSetKeyʸᴰ.NUMBERS, BaseGlyphSetNumber.class);
}
default BaseGlyphSetNumber BȍőnGlyphSetNumber16() {
return GET_BBC().GET_OBJ(BãßBȍőnGlyphSetKeyʸᴰ.HEXIMALS, BaseGlyphSetNumber.class);
}
default BaseGlyphSetNumber BȍőnGlyphSetNumber36() {
return GET_BBC().GET_OBJ(BãßBȍőnGlyphSetKeyʸᴰ.GEMATRIA, BaseGlyphSetNumber.class);
}
default String BȍőnPrintGlyphSetNumber10(int number, int numberMax) {
StringBuilder buf = new StringBuilder();
if (numberMax < 10) {
buf.append(BȍőnGlyphSetNumber10().BȍőnCharFor(number));
} else if (numberMax < 100) {
int count = number;
int mod10 = count % 10;
int div10 = count / 10 % 10;
buf.append(BȍőnGlyphSetNumber10().BȍőnCharFor(div10));
buf.append(BȍőnGlyphSetNumber10().BȍőnCharSeperator());
buf.append(BȍőnGlyphSetNumber10().BȍőnCharFor(mod10));
} else if (numberMax < 1000) {
int count = number;
int mod10 = count % 10;
int div10 = count / 10 % 10;
int div100 = count / 100 % 10;
buf.append(BȍőnGlyphSetNumber10().BȍőnCharFor(div10));
buf.append(BȍőnGlyphSetNumber10().BȍőnCharSeperator());
buf.append(BȍőnGlyphSetNumber10().BȍőnCharFor(div100));
buf.append(BȍőnGlyphSetNumber10().BȍőnCharSeperator());
buf.append(BȍőnGlyphSetNumber10().BȍőnCharFor(mod10));
} else {
throw new IllegalStateException("Can't handle more than 1000 values.");
}
if (BaseGlyphSet.HEBREW.equals(this)) {
return buf.reverse().toString(); // TODO: ImGui workaround
}
return buf.toString();
}
default String BȍőnPrintGlyphSetNumber16(int number, int numberMax) {
//BãßBȍőnGlyphSetʸᴰ<T> glyphSet = this;
StringBuilder buf = new StringBuilder();
if (numberMax < 16) {
buf.append(BȍőnGlyphSetNumber16().BȍőnCharFor(number));
} else if (numberMax < 256) {
buf.append(BȍőnGlyphSetNumber16().BȍőnCharFor(number >> 4));
buf.append(BȍőnGlyphSetNumber16().BȍőnCharSeperator());
BaseGlyphSet secondGlyphSet = BȍőnGlyphSetNumber16().BȍőnAltGlyphSet();
if (secondGlyphSet != null) {
buf.append(secondGlyphSet.BȍőnGlyphSetNumber16().BȍőnCharFor(number & 0x0F));
} else {
buf.append(BȍőnGlyphSetNumber16().BȍőnCharFor(number & 0x0F));
}
} else if (numberMax < 0xFFF+1) {
buf.append(BȍőnGlyphSetNumber16().BȍőnCharFor((number >> 8) & 0x0F));
buf.append(BȍőnGlyphSetNumber16().BȍőnCharSeperator());
BaseGlyphSet secondGlyphSet = BȍőnGlyphSetNumber16().BȍőnAltGlyphSet();
if (secondGlyphSet != null) {
buf.append(secondGlyphSet.BȍőnGlyphSetNumber16().BȍőnCharFor((number >> 4) & 0x0F));
buf.append(secondGlyphSet.BȍőnGlyphSetNumber16().BȍőnCharSeperator());
buf.append(secondGlyphSet.BȍőnGlyphSetNumber16().BȍőnCharFor(number & 0x0F));
} else {
buf.append(BȍőnGlyphSetNumber16().BȍőnCharFor((number >> 4) & 0x0F));
buf.append(BȍőnGlyphSetNumber16().BȍőnCharSeperator());
buf.append(BȍőnGlyphSetNumber16().BȍőnCharFor(number & 0x0F));
}
} else {
throw new IllegalStateException("Can't handle more than 0xFFF values.");
}
if (BaseGlyphSet.HEBREW.equals(this)) {
return buf.reverse().toString(); // TODO: ImGui workaround
}
return buf.toString();
}
default String BȍőnPrintGlyphSetNumber36(int number, int numberMax) {
StringBuilder buf = new StringBuilder();
if (numberMax < 9) {
buf.append(BȍőnGlyphSetNumber36().BȍőnCharFor36(number + 1));
} else if (numberMax < 99) {
int count = number + 1;
int mod10 = (count % 9) + 1;
int div10 = ((count / 9) % 9) + 1;
buf.append(BȍőnGlyphSetNumber36().BȍőnCharFor36(div10));
buf.append(BȍőnGlyphSetNumber36().BȍőnCharSeperator());
buf.append(BȍőnGlyphSetNumber36().BȍőnCharFor36(mod10));
} else if (numberMax < 999) {
int count = number;
int mod10 = (count % 9) + 1;
int div10 = ((count / 90) & 9) + 1;
int div100 = ((count / 900) & 9) + 1;
buf.append(BȍőnGlyphSetNumber36().BȍőnCharFor36(div10));
buf.append(BȍőnGlyphSetNumber36().BȍőnCharSeperator());
buf.append(BȍőnGlyphSetNumber36().BȍőnCharFor36(div100));
buf.append(BȍőnGlyphSetNumber36().BȍőnCharSeperator());
buf.append(BȍőnGlyphSetNumber36().BȍőnCharFor36(mod10));
} else {
throw new IllegalStateException("Can't handle more than 1000 values.");
}
if (BaseGlyphSet.HEBREW.equals(this)) {
return buf.reverse().toString(); // TODO: ImGui workaround
}
return buf.toString();
}
}

View file

@ -55,9 +55,11 @@ public class SystemBaseGlyphRenderer extends ImGuiRendererMain {
private String print16Numbers(BaseGlyphSet set) { private String print16Numbers(BaseGlyphSet set) {
StringBuilder buf = new StringBuilder(); StringBuilder buf = new StringBuilder();
int x=240;
for (int i=0;i<16;i++) { for (int i=0;i<16;i++) {
buf.append(set.BȍőnPrintGlyphSetNumber16(i, 99)); buf.append(set.BȍőnPrintGlyphSetNumber16(i + x, 99));
buf.append(" "); buf.append(" ");
x = x - 16;
} }
return buf.toString(); return buf.toString();
} }

View file

@ -100,17 +100,17 @@ public class SystemBasePartRenderer extends ImGuiRendererMain {
ImGui.tableNextColumn(); ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber16(BaseGlyphSet.KOREAN)); ImGui.text(part.BȍőnPrintGlyphSetNumber16(BaseGlyphSet.KOREAN));
ImGui.tableNextColumn(); ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber10(BaseGlyphSet.LATIN_BASIC)); ImGui.text(part.BȍőnPrintGlyphSetNumber16(BaseGlyphSet.LATIN_BASIC));
ImGui.tableNextColumn(); ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber36(BaseGlyphSet.TONE_SCRIPT)); ImGui.text(part.BȍőnPrintGlyphSetNumber27(BaseGlyphSet.TONE_SCRIPT));
ImGui.tableNextColumn(); ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber36(BaseGlyphSet.KOREAN)); ImGui.text(part.BȍőnPrintGlyphSetNumber27(BaseGlyphSet.KOREAN));
ImGui.tableNextColumn(); ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber36(BaseGlyphSet.LATIN_BASIC)); ImGui.text(part.BȍőnPrintGlyphSetNumber27(BaseGlyphSet.LATIN_BASIC));
ImGui.tableNextColumn(); ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber36(BaseGlyphSet.GREEK)); ImGui.text(part.BȍőnPrintGlyphSetNumber27(BaseGlyphSet.GREEK));
ImGui.tableNextColumn(); ImGui.tableNextColumn();
ImGui.text(part.BȍőnPrintGlyphSetNumber36(BaseGlyphSet.HEBREW)); ImGui.text(part.BȍőnPrintGlyphSetNumber27(BaseGlyphSet.HEBREW));
ImGui.tableNextColumn(); ImGui.tableNextColumn();
ImGui.text(part.BȍőnChinaKey()); ImGui.text(part.BȍőnChinaKey());
ImGui.tableNextColumn(); ImGui.tableNextColumn();