From 090985f6fe1bffd0372505621c96a88088202981 Mon Sep 17 00:00:00 2001 From: Willem Cazander Date: Fri, 28 Jan 2022 18:47:03 +0100 Subject: [PATCH] freed getal name for calculation code. --- .../{HebrewGê̄ld.java => Gê̄ldGetậl.java} | 86 +++++++++---------- .../{HebrewGetậl.java => HebrewDigit.java} | 34 ++++---- ...etậlLetter.java => HebrewDigitLetter.java} | 12 +-- ...wGetậlVowel.java => HebrewDigitVowel.java} | 12 +-- .../demo4d/screen/HebrewWalletRenderer.java | 4 +- 5 files changed, 74 insertions(+), 74 deletions(-) rename core/src/love/distributedrebirth/demo4d/fraction4d/{HebrewGê̄ld.java => Gê̄ldGetậl.java} (61%) rename core/src/love/distributedrebirth/demo4d/fraction4d/{HebrewGetậl.java => HebrewDigit.java} (66%) rename core/src/love/distributedrebirth/demo4d/fraction4d/{HebrewGetậlLetter.java => HebrewDigitLetter.java} (88%) rename core/src/love/distributedrebirth/demo4d/fraction4d/{HebrewGetậlVowel.java => HebrewDigitVowel.java} (78%) diff --git a/core/src/love/distributedrebirth/demo4d/fraction4d/HebrewGê̄ld.java b/core/src/love/distributedrebirth/demo4d/fraction4d/Gê̄ldGetậl.java similarity index 61% rename from core/src/love/distributedrebirth/demo4d/fraction4d/HebrewGê̄ld.java rename to core/src/love/distributedrebirth/demo4d/fraction4d/Gê̄ldGetậl.java index 7d5c2638..5a3a7380 100644 --- a/core/src/love/distributedrebirth/demo4d/fraction4d/HebrewGê̄ld.java +++ b/core/src/love/distributedrebirth/demo4d/fraction4d/Gê̄ldGetậl.java @@ -7,26 +7,26 @@ import love.distributedrebirth.demo4d.base2t.T04PartQuad; import love.distributedrebirth.demo4d.base2t.V018Tord; import love.distributedrebirth.demo4d.base2t.V036Teger; -public class HebrewGê̄ld { +public class Gê̄ldGetậl { - private final HebrewGetậl nummerAlphabet; - private final HebrewGetậl nummerDeelA; - private final HebrewGetậl nummerDeelB; - private final HebrewGetậl nummerDeelC; + private final HebrewDigit nummerAlphabet; + private final HebrewDigit nummerDeelA; + private final HebrewDigit nummerDeelB; + private final HebrewDigit nummerDeelC; private final double totalDecimalValue; private static final Character LEFT_TO_RIGHT_MARK = 0x200E; private static final Character RIGHT_TO_LEFT_MARK = 0x200F; - public HebrewGê̄ld(V036Teger teger) { + public Gê̄ldGetậl(V036Teger teger) { this( - new HebrewGetậl(teger.getTytePart(T04PartQuad.PART_1)), - new HebrewGetậl(teger.getTytePart(T04PartQuad.PART_2)), - new HebrewGetậl(teger.getTytePart(T04PartQuad.PART_3)), - new HebrewGetậl(teger.getTytePart(T04PartQuad.PART_4)) + new HebrewDigit(teger.getTytePart(T04PartQuad.PART_1)), + new HebrewDigit(teger.getTytePart(T04PartQuad.PART_2)), + new HebrewDigit(teger.getTytePart(T04PartQuad.PART_3)), + new HebrewDigit(teger.getTytePart(T04PartQuad.PART_4)) ); } - public HebrewGê̄ld(HebrewGetậl nummerAlphabet, HebrewGetậl nummerDeelA, HebrewGetậl nummerDeelB, HebrewGetậl nummerDeelC) { + public Gê̄ldGetậl(HebrewDigit nummerAlphabet, HebrewDigit nummerDeelA, HebrewDigit nummerDeelB, HebrewDigit nummerDeelC) { this.nummerAlphabet = nummerAlphabet; this.nummerDeelA = nummerDeelA; this.nummerDeelB = nummerDeelB; @@ -34,7 +34,7 @@ public class HebrewGê̄ld { this.totalDecimalValue = calculateDecimalValue(); } - public HebrewGê̄ld(String money) { + public Gê̄ldGetậl(String money) { if (money == null) { throw new NullPointerException("Can't parse null money"); } @@ -44,9 +44,9 @@ public class HebrewGê̄ld { if (money.length() > 8) { // RL + 4 chars + 3 vowels throw new IllegalArgumentException("Money length should not exceed 8 codepoints"); } - List result = new ArrayList<>(); + List result = new ArrayList<>(); - HebrewGetậl geldDigit = null; + HebrewDigit geldDigit = null; for (int i=0;i 1) { deelA = result.get(1); } else { - deelA = new HebrewGetậl(); + deelA = new HebrewDigit(); } if (result.size() > 2) { deelB = result.get(2); } else { - deelB = new HebrewGetậl(); + deelB = new HebrewDigit(); } if (result.size() > 3) { deelC = result.get(3); } else { - deelC = new HebrewGetậl(); + deelC = new HebrewDigit(); } this.nummerAlphabet = full; this.nummerDeelA = deelA; @@ -107,35 +107,35 @@ public class HebrewGê̄ld { private double calculateDecimalValue() { boolean hasFourDigits = - !HebrewGetậlLetter.NONE.equals(nummerDeelA.getLetter()) && - !HebrewGetậlLetter.NONE.equals(nummerDeelB.getLetter()) && - !HebrewGetậlLetter.NONE.equals(nummerDeelC.getLetter()); + !HebrewDigitLetter.NONE.equals(nummerDeelA.getLetter()) && + !HebrewDigitLetter.NONE.equals(nummerDeelB.getLetter()) && + !HebrewDigitLetter.NONE.equals(nummerDeelC.getLetter()); double totalDecimalValue = nummerAlphabet.toDecimalValue(hasFourDigits); - if (!HebrewGetậlLetter.NONE.equals(nummerDeelA.getLetter())) { + if (!HebrewDigitLetter.NONE.equals(nummerDeelA.getLetter())) { totalDecimalValue += nummerDeelA.toDecimalValue(false); } - if (!HebrewGetậlLetter.NONE.equals(nummerDeelB.getLetter())) { + if (!HebrewDigitLetter.NONE.equals(nummerDeelB.getLetter())) { totalDecimalValue += nummerDeelB.toDecimalValue(false); } - if (!HebrewGetậlLetter.NONE.equals(nummerDeelC.getLetter())) { + if (!HebrewDigitLetter.NONE.equals(nummerDeelC.getLetter())) { totalDecimalValue += nummerDeelC.toDecimalValue(false); } return totalDecimalValue; } - public HebrewGetậl getNummerAlphabet() { + public HebrewDigit getNummerAlphabet() { return nummerAlphabet; } - public HebrewGetậl getNummerDeelA() { + public HebrewDigit getNummerDeelA() { return nummerDeelA; } - public HebrewGetậl getNummerDeelB() { + public HebrewDigit getNummerDeelB() { return nummerDeelB; } - public HebrewGetậl getNummerDeelC() { + public HebrewDigit getNummerDeelC() { return nummerDeelC; } @@ -158,24 +158,24 @@ public class HebrewGê̄ld { StringBuilder buf = new StringBuilder(); buf.append(RIGHT_TO_LEFT_MARK); buf.append(nummerAlphabet.getLetter().getCharacter()); - if (!HebrewGetậlVowel.NONE.equals(nummerAlphabet.getVowel())) { + if (!HebrewDigitVowel.NONE.equals(nummerAlphabet.getVowel())) { buf.append(nummerAlphabet.getVowel().getCharacter()); } - if (!HebrewGetậlLetter.NONE.equals(nummerDeelA.getLetter())) { + if (!HebrewDigitLetter.NONE.equals(nummerDeelA.getLetter())) { buf.append(nummerDeelA.getLetter().getCharacter()); - if (!HebrewGetậlVowel.NONE.equals(nummerDeelA.getVowel())) { + if (!HebrewDigitVowel.NONE.equals(nummerDeelA.getVowel())) { buf.append(nummerDeelA.getVowel().getCharacter()); } } - if (!HebrewGetậlLetter.NONE.equals(nummerDeelB.getLetter())) { + if (!HebrewDigitLetter.NONE.equals(nummerDeelB.getLetter())) { buf.append(nummerDeelB.getLetter().getCharacter()); - if (!HebrewGetậlVowel.NONE.equals(nummerDeelB.getVowel())) { + if (!HebrewDigitVowel.NONE.equals(nummerDeelB.getVowel())) { buf.append(nummerDeelB.getVowel().getCharacter()); } } - if (!HebrewGetậlLetter.NONE.equals(nummerDeelC.getLetter())) { + if (!HebrewDigitLetter.NONE.equals(nummerDeelC.getLetter())) { buf.append(nummerDeelC.getLetter().getCharacter()); - if (!HebrewGetậlVowel.NONE.equals(nummerDeelC.getVowel())) { + if (!HebrewDigitVowel.NONE.equals(nummerDeelC.getVowel())) { buf.append(nummerDeelC.getVowel().getCharacter()); } } diff --git a/core/src/love/distributedrebirth/demo4d/fraction4d/HebrewGetậl.java b/core/src/love/distributedrebirth/demo4d/fraction4d/HebrewDigit.java similarity index 66% rename from core/src/love/distributedrebirth/demo4d/fraction4d/HebrewGetậl.java rename to core/src/love/distributedrebirth/demo4d/fraction4d/HebrewDigit.java index e7b75777..9e8490e8 100644 --- a/core/src/love/distributedrebirth/demo4d/fraction4d/HebrewGetậl.java +++ b/core/src/love/distributedrebirth/demo4d/fraction4d/HebrewDigit.java @@ -4,34 +4,34 @@ import love.distributedrebirth.demo4d.base2t.T03PartTrit; import love.distributedrebirth.demo4d.base2t.T08PartOctal; import love.distributedrebirth.demo4d.base2t.V009Tyte; -public class HebrewGetậl { +public class HebrewDigit { private static final double NUMERATOR_ONE = 1d; private static final int FRACTION_POWER = 10; - private HebrewGetậlLetter letter; - private HebrewGetậlVowel vowel; + private HebrewDigitLetter letter; + private HebrewDigitVowel vowel; - public HebrewGetậl() { - this.letter = HebrewGetậlLetter.NONE; - this.vowel = HebrewGetậlVowel.NONE; + public HebrewDigit() { + this.letter = HebrewDigitLetter.NONE; + this.vowel = HebrewDigitVowel.NONE; } - public HebrewGetậl(HebrewGetậlLetter letter) { + public HebrewDigit(HebrewDigitLetter letter) { this.letter = letter; - this.vowel = HebrewGetậlVowel.NONE; + this.vowel = HebrewDigitVowel.NONE; } - public HebrewGetậl(V009Tyte tyte) { + public HebrewDigit(V009Tyte tyte) { int value0 = tyte.getValue(T03PartTrit.PART_1).getValue().ordinalOf(T08PartOctal.PART_1); int value1 = tyte.getValue(T03PartTrit.PART_2).getValue().ordinalOf(T08PartOctal.PART_2); int value2 = tyte.getValue(T03PartTrit.PART_3).getValue().ordinalOf(T08PartOctal.PART_3); int combinedValue = value0 + value1 + value2; - letter = HebrewGetậlLetter.indexOf(combinedValue); - vowel = HebrewGetậlVowel.indexOf(combinedValue >> HebrewGetậlLetter.SHIFT_5); + letter = HebrewDigitLetter.indexOf(combinedValue); + vowel = HebrewDigitVowel.indexOf(combinedValue >> HebrewDigitLetter.SHIFT_5); } public V009Tyte toTyte() { - int combinedValue = letter.ordinal() + (vowel.ordinal() << HebrewGetậlLetter.SHIFT_5); + int combinedValue = letter.ordinal() + (vowel.ordinal() << HebrewDigitLetter.SHIFT_5); T08PartOctal value0 = T08PartOctal.indexOf(T08PartOctal.PART_1, combinedValue); T08PartOctal value1 = T08PartOctal.indexOf(T08PartOctal.PART_2, combinedValue); T08PartOctal value2 = T08PartOctal.indexOf(T08PartOctal.PART_3, combinedValue); @@ -43,26 +43,26 @@ public class HebrewGetậl { if (firstChar) { return fraction; // use full value } - if (!HebrewGetậlVowel.NONE.equals(vowel)) { + if (!HebrewDigitVowel.NONE.equals(vowel)) { fraction = fraction * Math.pow(FRACTION_POWER, vowel.getFractionOffset()); } double result = NUMERATOR_ONE/fraction; return result; } - public HebrewGetậlLetter getLetter() { + public HebrewDigitLetter getLetter() { return letter; } - public void setLetter(HebrewGetậlLetter letter) { + public void setLetter(HebrewDigitLetter letter) { this.letter = letter; } - public HebrewGetậlVowel getVowel() { + public HebrewDigitVowel getVowel() { return vowel; } - public void setVowel(HebrewGetậlVowel vowel) { + public void setVowel(HebrewDigitVowel vowel) { this.vowel = vowel; } } diff --git a/core/src/love/distributedrebirth/demo4d/fraction4d/HebrewGetậlLetter.java b/core/src/love/distributedrebirth/demo4d/fraction4d/HebrewDigitLetter.java similarity index 88% rename from core/src/love/distributedrebirth/demo4d/fraction4d/HebrewGetậlLetter.java rename to core/src/love/distributedrebirth/demo4d/fraction4d/HebrewDigitLetter.java index 802bc2bb..5c001905 100644 --- a/core/src/love/distributedrebirth/demo4d/fraction4d/HebrewGetậlLetter.java +++ b/core/src/love/distributedrebirth/demo4d/fraction4d/HebrewDigitLetter.java @@ -1,6 +1,6 @@ package love.distributedrebirth.demo4d.fraction4d; -public enum HebrewGetậlLetter { +public enum HebrewDigitLetter { // Unicode is horror in any language else than ascii; // VS Alphabet order // VS Unicode order @@ -70,7 +70,7 @@ public enum HebrewGetậlLetter { private final int decimal; private final char character; - private HebrewGetậlLetter(int decimal, char character) { + private HebrewDigitLetter(int decimal, char character) { this.decimal = decimal; this.character = character; } @@ -83,16 +83,16 @@ public enum HebrewGetậlLetter { return character; } - public static HebrewGetậlLetter indexOf(int index) { + public static HebrewDigitLetter indexOf(int index) { return values()[index & BITMASK]; } - public static HebrewGetậlLetter valueOf(char codePoint) { - for (HebrewGetậlLetter vowel:values()) { + public static HebrewDigitLetter valueOf(char codePoint) { + for (HebrewDigitLetter vowel:values()) { if (vowel.getCharacter() == codePoint) { return vowel; } } - return HebrewGetậlLetter.NONE; + return HebrewDigitLetter.NONE; } } diff --git a/core/src/love/distributedrebirth/demo4d/fraction4d/HebrewGetậlVowel.java b/core/src/love/distributedrebirth/demo4d/fraction4d/HebrewDigitVowel.java similarity index 78% rename from core/src/love/distributedrebirth/demo4d/fraction4d/HebrewGetậlVowel.java rename to core/src/love/distributedrebirth/demo4d/fraction4d/HebrewDigitVowel.java index 1f9d12f4..805eaaa6 100644 --- a/core/src/love/distributedrebirth/demo4d/fraction4d/HebrewGetậlVowel.java +++ b/core/src/love/distributedrebirth/demo4d/fraction4d/HebrewDigitVowel.java @@ -1,6 +1,6 @@ package love.distributedrebirth.demo4d.fraction4d; -public enum HebrewGetậlVowel { +public enum HebrewDigitVowel { NONE (0, (char) 0x0000), VOWEL_1 (1, (char) 0x05B4), VOWEL_2 (2, (char) 0x05B5), @@ -23,7 +23,7 @@ public enum HebrewGetậlVowel { private final int fractionOffset; private final char character; - private HebrewGetậlVowel(int fractionOffset, char character) { + private HebrewDigitVowel(int fractionOffset, char character) { this.fractionOffset = fractionOffset; this.character = character; } @@ -36,16 +36,16 @@ public enum HebrewGetậlVowel { return character; } - public static HebrewGetậlVowel indexOf(int index) { + public static HebrewDigitVowel indexOf(int index) { return values()[index & BITMASK]; } - public static HebrewGetậlVowel valueOf(char codePoint) { - for (HebrewGetậlVowel vowel:values()) { + public static HebrewDigitVowel valueOf(char codePoint) { + for (HebrewDigitVowel vowel:values()) { if (vowel.getCharacter() == codePoint) { return vowel; } } - return HebrewGetậlVowel.NONE; + return HebrewDigitVowel.NONE; } } diff --git a/core/src/love/distributedrebirth/demo4d/screen/HebrewWalletRenderer.java b/core/src/love/distributedrebirth/demo4d/screen/HebrewWalletRenderer.java index 2e559bd8..4989d551 100644 --- a/core/src/love/distributedrebirth/demo4d/screen/HebrewWalletRenderer.java +++ b/core/src/love/distributedrebirth/demo4d/screen/HebrewWalletRenderer.java @@ -6,7 +6,7 @@ import imgui.flag.ImGuiTableFlags; import imgui.type.ImBoolean; import love.distributedrebirth.demo4d.Demo4DMain; import love.distributedrebirth.demo4d.ImGuiRendererMain; -import love.distributedrebirth.demo4d.fraction4d.HebrewGê̄ld; +import love.distributedrebirth.demo4d.fraction4d.Gê̄ldGetậl; public class HebrewWalletRenderer extends ImGuiRendererMain { @@ -40,7 +40,7 @@ public class HebrewWalletRenderer extends ImGuiRendererMain { "הזפץ","מספר","צצצצ","ץאאא","דואר" }; for (String data:walletData) { - HebrewGê̄ld geld = new HebrewGê̄ld(data); + Gê̄ldGetậl geld = new Gê̄ldGetậl(data); ImGui.tableNextRow(); ImGui.tableNextColumn(); ImGui.text(data.length()==2||data.length()==3?"OUT":"IN");