From bb76cbbe2f208fc78599a05df93593b718f64a3c Mon Sep 17 00:00:00 2001 From: Willem Date: Thu, 10 Feb 2022 14:45:52 +0100 Subject: [PATCH] Added number convert method --- .../numberxd/glyph/BaseGlyphSet.java | 13 +++++++++++++ .../numberxd/glyph/BaseGlyphSetNumber.java | 4 ++++ 2 files changed, 17 insertions(+) diff --git a/lib-numberxd/src/main/love/distributedrebirth/numberxd/glyph/BaseGlyphSet.java b/lib-numberxd/src/main/love/distributedrebirth/numberxd/glyph/BaseGlyphSet.java index 5052e053..11959eed 100644 --- a/lib-numberxd/src/main/love/distributedrebirth/numberxd/glyph/BaseGlyphSet.java +++ b/lib-numberxd/src/main/love/distributedrebirth/numberxd/glyph/BaseGlyphSet.java @@ -112,4 +112,17 @@ public enum BaseGlyphSet implements BãßBȍőnGlyphSetʸᴰ { BBC.BOON_INIT(this); this.BȍőnJmxInit(BãßBȍőnGlyphSetKeyʸᴰ.JMX); } + + public String BȍőnConvertTo(String numbers) { + StringBuilder buf = new StringBuilder(); + for (char c:numbers.toCharArray()) { + for (BaseGlyphSet set:values()) { + int loc = set.BȍőnGlyphSetNumber10().BȍőnIndexOf(""+c); + if (loc != -1) { + buf.append(set.BȍőnGlyphSetNumber10().BȍőnCharFor(loc)); + } + } + } + return buf.toString(); + } } diff --git a/lib-numberxd/src/main/love/distributedrebirth/numberxd/glyph/BaseGlyphSetNumber.java b/lib-numberxd/src/main/love/distributedrebirth/numberxd/glyph/BaseGlyphSetNumber.java index ddaa7547..d23cb0cb 100644 --- a/lib-numberxd/src/main/love/distributedrebirth/numberxd/glyph/BaseGlyphSetNumber.java +++ b/lib-numberxd/src/main/love/distributedrebirth/numberxd/glyph/BaseGlyphSetNumber.java @@ -114,6 +114,10 @@ public final class BaseGlyphSetNumber { return chars.get(number); } + public int BȍőnIndexOf(String str) { + return chars.indexOf(str); + } + public String BȍőnCharSeperator() { return charSeperator; }