Created DefaultBãßBȍőn interface

This commit is contained in:
Willem Cazander 2022-10-14 01:35:53 +02:00
parent 3acc28dbbf
commit 2e29efb5fe
78 changed files with 963 additions and 606 deletions

View file

@ -1,5 +1,6 @@
package love.distributedrebirth.numberxd.unicode;
import java.math.BigInteger;
import java.text.DecimalFormat;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
@ -20,13 +21,20 @@ public enum BaseGlyphSet implements DefaultEnumSetᴶᴹˣ<BaseGlyphSet,BaseGlyp
// TODO: Move this into unicode4D and TyyPartXxx
LATIN_BASIC(
new BaseGlyphSetNumber(v -> T10PartDecimal.DEFAULT.BãßVoorElk(x -> v.add(Integer.toString(x.BȍőnRangTelNul())))),
new BaseGlyphSetNumber(v -> T16PartHex.DEFAULT.BãßVoorElk(x -> v.add(x.BȍőnAlt1Value()))),
new BaseGlyphSetNumber(v -> T10PartDecimal.STATIC.BãßVoorElk(x -> v.add(Integer.toString(x.BȍőnRangTelNul())))),
new BaseGlyphSetNumber(v -> T16PartHex.STATIC.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")),
LATIN_DTMF(
new BaseGlyphSetNumber(v -> T10PartDecimal.DEFAULT.BãßVoorElk(x -> v.add(x.BȍőnChinaValue()))).withSeperator(BãßBȍőnConstantsʸᴰ.STR_SPACE),
new BaseGlyphSetNumber(v -> T10PartDecimal.STATIC.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"),
null),
new BaseGlyphSetNumber(v -> T10PartDecimal.STATIC.BãßVoorElk(x -> {
if (T10PartDecimal.PART_10 == x) {
v.add("ten");
} else {
v.add(T10PartDecimal.STATIC.BãßInstances()[x.BȍőnRangTelEen()].BȍőnChinaValue()); // 1 to 9
}
}), "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety",
"one hundred", "two hundred", "three hundred", "four hundred", "five hundred", "six hundred", "seven hundred", "eight hundred", "nine hundred")),
LATIN_TOP(
new BaseGlyphSetNumber("","¹","²","³","","","","","",""),
new BaseGlyphSetNumber("","¹","²","³","","","","","","","","","","","",""),
@ -45,23 +53,23 @@ public enum BaseGlyphSet implements DefaultEnumSetᴶᴹˣ<BaseGlyphSet,BaseGlyp
null),
TONE_SCRIPT(
new BaseGlyphSetNumber(v -> T10PartDecimal.DEFAULT.BãßVoorElk(x -> v.add(x.BȍőnDialTone()))),
new BaseGlyphSetNumber(v -> T16PartHex.DEFAULT.BãßVoorElk(x -> v.add(x.BȍőnDialTone()))),
new BaseGlyphSetNumber(v -> T10PartDecimal.STATIC.BãßVoorElk(x -> v.add(x.BȍőnDialTone()))),
new BaseGlyphSetNumber(v -> T16PartHex.STATIC.BãßVoorElk(x -> v.add(x.BȍőnDialTone()))),
new BaseGlyphSetNumber("꜊꜈","꜊꜉","꜊꜋","꜊꜌","꜊꜍","꜊꜎","꜊꜏","꜊꜐","꜊꜑","˧˥","˧˦","˧˨","˧˩","˧꜒","˧꜓","˧꜔","˧꜕","˧꜖","꜏˥","꜏˦","꜏˧","꜏˨","꜏˩","꜏꜍","꜏꜎","꜏꜐","꜏꜑")),
DIPAVALI_LRPATH_TOPHEX(
new BaseGlyphSetNumber(v -> T10PartDecimal.DEFAULT.BãßVoorElk(x -> v.add(x.BȍőnAlt1Value()))),
new BaseGlyphSetNumber(v -> T10PartDecimal.STATIC.BãßVoorElk(x -> v.add(x.BȍőnAlt1Value()))),
new BaseGlyphSetNumber("˧˥˩","˧˩˥","˧˥˦","˧˩˨","˧˦˦","˧˨˨","˧˥˥","˧˩˩","˥˩˧","˩˥˧","˥˦˧","˩˨˧","˦˦˧","˨˨˧","˥˥˧","˩˩˧").withAltGlyphSet(BaseGlyphSet.LATIN_TOP),
TONE_SCRIPT.BȍőnNumber27()),
DIPAVALI_LRPATH_SUBHEX(
new BaseGlyphSetNumber(v -> T10PartDecimal.DEFAULT.BãßVoorElk(x -> v.add(x.BȍőnAlt1Value()))),
new BaseGlyphSetNumber(v -> T10PartDecimal.STATIC.BãßVoorElk(x -> v.add(x.BȍőnAlt1Value()))),
new BaseGlyphSetNumber("˧˥˩","˧˩˥","˧˥˦","˧˩˨","˧˦˦","˧˨˨","˧˥˥","˧˩˩","˥˩˧","˩˥˧","˥˦˧","˩˨˧","˦˦˧","˨˨˧","˥˥˧","˩˩˧").withAltGlyphSet(BaseGlyphSet.LATIN_SUB),
TONE_SCRIPT.BȍőnNumber27()),
DIPAVALI_RLPATH_TOPHEX(
new BaseGlyphSetNumber(v -> T10PartDecimal.DEFAULT.BãßVoorElk(x -> v.add(x.BȍőnAlt2Value()))),
new BaseGlyphSetNumber(v -> T10PartDecimal.STATIC.BãßVoorElk(x -> v.add(x.BȍőnAlt2Value()))),
new BaseGlyphSetNumber("꜔꜒꜖","꜔꜖꜒","꜔꜒꜓","꜔꜖꜕","꜔꜓꜓","꜔꜕꜕","꜔꜒꜒","꜔꜖꜖","꜒꜖꜔","꜖꜒꜔","꜒꜓꜔","꜖꜕꜔","꜓꜓꜔","꜕꜕꜔","꜒꜒꜔","꜖꜖꜔").withAltGlyphSet(BaseGlyphSet.LATIN_TOP),
TONE_SCRIPT.BȍőnNumber27()),
DIPAVALI_RLPATH_SUBHEX(
new BaseGlyphSetNumber(v -> T10PartDecimal.DEFAULT.BãßVoorElk(x -> v.add(x.BȍőnAlt2Value()))),
new BaseGlyphSetNumber(v -> T10PartDecimal.STATIC.BãßVoorElk(x -> v.add(x.BȍőnAlt2Value()))),
new BaseGlyphSetNumber("꜔꜒꜖","꜔꜖꜒","꜔꜒꜓","꜔꜖꜕","꜔꜓꜓","꜔꜕꜕","꜔꜒꜒","꜔꜖꜖","꜒꜖꜔","꜖꜒꜔","꜒꜓꜔","꜖꜕꜔","꜓꜓꜔","꜕꜕꜔","꜒꜒꜔","꜖꜖꜔").withAltGlyphSet(BaseGlyphSet.LATIN_SUB),
TONE_SCRIPT.BȍőnNumber27()),
@ -96,7 +104,7 @@ public enum BaseGlyphSet implements DefaultEnumSetᴶᴹˣ<BaseGlyphSet,BaseGlyp
new BaseGlyphSetNumber("\ue429","\ue3fa","\ue3fb","\ue3fc","\ue3fd","\ue3fe","\ue3ff","\ue400","\ue401","\ue401").withSeperator(BãßBȍőnConstantsʸᴰ.STR_SPACE),
new BaseGlyphSetNumber("\uE236","\uE237","\uE238","\uE239","\uE23A","\uE23B","\uE23C","\uE23D","\uE23E","\uE23F","\uE241","\uE243","\uE244","\uE245","\uE246","\uE247"),
new BaseGlyphSetNumber(
"\ue3fa","\ue3fb","\ue3fc","\ue3fd","\ue3fe","\ue3ff","\ue400","\ue401","\ue401",
"\ue3fa","\ue3fb","\ue3fc","\ue3fd","\ue3fe","\ue3ff","\ue400","\ue401","\ue402",
"\ue386","\ue387","\ue388","\ue389","\ue38a","\ue38b","\ue38c","\ue38d","\ue38e",
"\ue362","\ue363","\ue364","\ue365","\ue366","\ue367","\ue368","\ue369","\ue36a").withSeperator(BãßBȍőnConstantsʸᴰ.STR_SPACE)
),
@ -117,7 +125,7 @@ public enum BaseGlyphSet implements DefaultEnumSetᴶᴹˣ<BaseGlyphSet,BaseGlyp
// TODO: replace Tai Xuan Jing Symbols are "T87PartXuanJing"
new BaseGlyphSetNumber("𝌁","𝌂","𝌃","𝌄","𝌅","𝌆","𝌇","𝌈","𝌉","𝌊","𝌋","𝌌","𝌍","𝌎","𝌏","𝌐","𝌑","𝌒","𝌓","𝌔","𝌕","𝌖","𝌗","𝌘","𝌙","𝌚","𝌛")),
CHINA_FORMAL(
new BaseGlyphSetNumber(v -> T10PartDecimal.DEFAULT.BãßVoorElk(x -> v.add(x.BȍőnChinaKey()))),
new BaseGlyphSetNumber(v -> T10PartDecimal.STATIC.BãßVoorElk(x -> v.add(x.BȍőnChinaKey()))),
null,
null),
CHINA_FORMAL_OLD(
@ -164,15 +172,15 @@ public enum BaseGlyphSet implements DefaultEnumSetᴶᴹˣ<BaseGlyphSet,BaseGlyp
}
private BaseGlyphSet(BaseGlyphSetNumber numbers, BaseGlyphSetNumber hex, BaseGlyphSetNumber gematria, Boolean reverseScript) {
BBC.PUT_OBJ(BaseGlyphSetKeyʸᴰ.NUMBERS, numbers);
BBC.PUT_OBJ(BaseGlyphSetKeyʸᴰ.HEXIMALS, hex);
BBC.PUT_OBJ(BaseGlyphSetKeyʸᴰ.GEMATRIA, gematria);
BBC.PUT_OBJ(BaseGlyphSetKeyʸᴰ.REVERSE_SCRIPT, reverseScript); // TODO: ImGui workaround
BBC.BOON_INIT(this);
this.BȍőnJmxInit(BaseGlyphSetKeyʸᴰ.JMX);
printNumber10Count = BȍőnJmxInitGuageCounter(BaseGlyphSetKeyʸᴰ.JMX, "printNumber10Count");
printNumber16Count = BȍőnJmxInitGuageCounter(BaseGlyphSetKeyʸᴰ.JMX, "printNumber16Count");
printNumber27Count = BȍőnJmxInitGuageCounter(BaseGlyphSetKeyʸᴰ.JMX, "printNumber27Count");
BOON_INIT(BBC -> {
BBC.PUT_OBJ(BaseGlyphSetKeyʸᴰ.NUMBERS, numbers);
BBC.PUT_OBJ(BaseGlyphSetKeyʸᴰ.HEXIMALS, hex);
BBC.PUT_OBJ(BaseGlyphSetKeyʸᴰ.GEMATRIA, gematria);
BBC.PUT_OBJ(BaseGlyphSetKeyʸᴰ.REVERSE_SCRIPT, reverseScript); // TODO: ImGui workaround
});
printNumber10Count = BȍőnJmxInitGuageCounter("printNumber10Count");
printNumber16Count = BȍőnJmxInitGuageCounter("printNumber16Count");
printNumber27Count = BȍőnJmxInitGuageCounter("printNumber27Count");
}
public BaseGlyphSetNumber BȍőnNumber10() {
@ -204,6 +212,24 @@ public enum BaseGlyphSet implements DefaultEnumSetᴶᴹˣ<BaseGlyphSet,BaseGlyp
return buf.toString();
}
public String BȍőnPrintNumber10(BigInteger number) {
String amount10 = number.toString(T10PartDecimal.STATIC.BãßĦǿɇṽḝę̃ɬḪễïđ());
StringBuilder buf16 = new StringBuilder();
for (char c:amount10.toCharArray()) {
if (BȍőnNumber10() == null) {
break;
}
int numberDigit = 0;
if (c >= 'a') {
numberDigit = c - 'a' + 10;
} else {
numberDigit = c - '0';
}
buf16.append(BȍőnPrintNumber10(numberDigit));
}
return buf16.toString();
}
public String BȍőnPrintNumber10(int number) {
return BȍőnPrintNumber10(number, number);
}
@ -231,6 +257,36 @@ public enum BaseGlyphSet implements DefaultEnumSetᴶᴹˣ<BaseGlyphSet,BaseGlyp
return buf.toString();
}
public String BȍőnPrintNumber16(BigInteger number) {
String amount16 = number.toString(T16PartHex.STATIC.BãßĦǿɇṽḝę̃ɬḪễïđ());
StringBuilder buf16 = new StringBuilder();
int c2 = 0;
for (char c:amount16.toCharArray()) {
if (BȍőnNumber16() == null) {
break;
}
int numberDigit = 0;
if (c >= 'a') {
numberDigit = c - 'a' + 10;
} else {
numberDigit = c - '0';
}
if (c2 == 0) {
c2 = numberDigit * 16;
continue;
} else {
c2 = numberDigit + c2;
}
buf16.append(BȍőnPrintNumber16(c2));
c2 = 0;
}
return buf16.toString();
}
public String BȍőnPrintNumber16(int number) {
return BȍőnPrintNumber16(number, number);
}
public String BȍőnPrintNumber16(int number, int numberMax) {
printNumber16Count.increment();
String maxDigitNumber = Integer.toHexString(numberMax);
@ -265,6 +321,10 @@ public enum BaseGlyphSet implements DefaultEnumSetᴶᴹˣ<BaseGlyphSet,BaseGlyp
return buf.toString();
}
public String BȍőnPrintNumber27(int number) {
return BȍőnPrintNumber27(number, number);
}
public String BȍőnPrintNumber27(int number, int numberMax) {
printNumber27Count.increment();
String maxDigitNumber = Integer.toString(numberMax, 27);