diff --git a/core/src/love/distributedrebirth/demo4d/base2t/V003Timble.java b/core/src/love/distributedrebirth/demo4d/base2t/V003Timble.java index d0032164..448dcb9a 100644 --- a/core/src/love/distributedrebirth/demo4d/base2t/V003Timble.java +++ b/core/src/love/distributedrebirth/demo4d/base2t/V003Timble.java @@ -7,6 +7,7 @@ package love.distributedrebirth.demo4d.base2t; */ public final class V003Timble implements BaseNumber { + public static int BIT_COUNT = T08PartOctal.BIT_COUNT; private T08PartOctal value; public V003Timble() { @@ -31,7 +32,7 @@ public final class V003Timble implements BaseNumber { @Override public int getBitCount() { - return T08PartOctal.BIT_COUNT; + return BIT_COUNT; } @Override diff --git a/core/src/love/distributedrebirth/demo4d/base2t/V006Tixte.java b/core/src/love/distributedrebirth/demo4d/base2t/V006Tixte.java index d495987d..01f21432 100644 --- a/core/src/love/distributedrebirth/demo4d/base2t/V006Tixte.java +++ b/core/src/love/distributedrebirth/demo4d/base2t/V006Tixte.java @@ -7,6 +7,7 @@ package love.distributedrebirth.demo4d.base2t; */ public final class V006Tixte implements BaseNumber { + public static int BIT_COUNT = V003Timble.BIT_COUNT * T02PartBinary.LENGTH; private V003Timble[] values = new V003Timble[T02PartBinary.LENGTH]; public V006Tixte() { @@ -32,7 +33,7 @@ public final class V006Tixte implements BaseNumber { @Override public int getBitCount() { - return T08PartOctal.BIT_COUNT * T02PartBinary.LENGTH; + return BIT_COUNT; } @Override diff --git a/core/src/love/distributedrebirth/demo4d/base2t/V009Tyte.java b/core/src/love/distributedrebirth/demo4d/base2t/V009Tyte.java index afef90af..ffdee0f0 100644 --- a/core/src/love/distributedrebirth/demo4d/base2t/V009Tyte.java +++ b/core/src/love/distributedrebirth/demo4d/base2t/V009Tyte.java @@ -7,6 +7,7 @@ package love.distributedrebirth.demo4d.base2t; */ public final class V009Tyte implements BaseNumberTyte { + public static int BIT_COUNT = V003Timble.BIT_COUNT * T03PartTrit.LENGTH; private V003Timble[] values = new V003Timble[T03PartTrit.LENGTH]; public V009Tyte() { @@ -37,7 +38,7 @@ public final class V009Tyte implements BaseNumberTyte { @Override public int getBitCount() { - return T08PartOctal.BIT_COUNT * T03PartTrit.LENGTH; + return BIT_COUNT; } @Override diff --git a/core/src/love/distributedrebirth/demo4d/base2t/V018Tord.java b/core/src/love/distributedrebirth/demo4d/base2t/V018Tord.java index fc68729b..8f056483 100644 --- a/core/src/love/distributedrebirth/demo4d/base2t/V018Tord.java +++ b/core/src/love/distributedrebirth/demo4d/base2t/V018Tord.java @@ -7,6 +7,7 @@ package love.distributedrebirth.demo4d.base2t; */ public final class V018Tord implements BaseNumberTyte { + public static int BIT_COUNT = V009Tyte.BIT_COUNT * T02PartBinary.LENGTH; private V009Tyte[] values = new V009Tyte[T02PartBinary.LENGTH]; public V018Tord() { @@ -44,7 +45,7 @@ public final class V018Tord implements BaseNumberTyte { @Override public int getBitCount() { - return T08PartOctal.BIT_COUNT * T06PartSeximal.LENGTH; + return BIT_COUNT; } @Override diff --git a/core/src/love/distributedrebirth/demo4d/base2t/V027Temvig.java b/core/src/love/distributedrebirth/demo4d/base2t/V027Temvig.java index 98a9e743..eea2e6cb 100644 --- a/core/src/love/distributedrebirth/demo4d/base2t/V027Temvig.java +++ b/core/src/love/distributedrebirth/demo4d/base2t/V027Temvig.java @@ -7,6 +7,7 @@ package love.distributedrebirth.demo4d.base2t; */ public final class V027Temvig implements BaseNumberTyte { + public static int BIT_COUNT = V009Tyte.BIT_COUNT * T03PartTrit.LENGTH; private V009Tyte[] values = new V009Tyte[T03PartTrit.LENGTH]; public V027Temvig() { @@ -37,7 +38,7 @@ public final class V027Temvig implements BaseNumberTyte { @Override public int getBitCount() { - return T08PartOctal.BIT_COUNT * T03PartTrit.LENGTH * T03PartTrit.LENGTH; + return BIT_COUNT; } @Override diff --git a/core/src/love/distributedrebirth/demo4d/base2t/V036Teger.java b/core/src/love/distributedrebirth/demo4d/base2t/V036Teger.java index cb9e03ba..cbd0b047 100644 --- a/core/src/love/distributedrebirth/demo4d/base2t/V036Teger.java +++ b/core/src/love/distributedrebirth/demo4d/base2t/V036Teger.java @@ -7,6 +7,7 @@ package love.distributedrebirth.demo4d.base2t; */ public final class V036Teger implements BaseNumberTyte { + public static int BIT_COUNT = V018Tord.BIT_COUNT * T02PartBinary.LENGTH; private V018Tord[] values = new V018Tord[T02PartBinary.LENGTH]; public V036Teger() { @@ -46,7 +47,7 @@ public final class V036Teger implements BaseNumberTyte { @Override public int getBitCount() { - return T08PartOctal.BIT_COUNT * T12PartUncial.LENGTH; + return BIT_COUNT; } @Override diff --git a/core/src/love/distributedrebirth/demo4d/base2t/V072Tong.java b/core/src/love/distributedrebirth/demo4d/base2t/V072Tong.java index 73dd8d51..22d72dbd 100644 --- a/core/src/love/distributedrebirth/demo4d/base2t/V072Tong.java +++ b/core/src/love/distributedrebirth/demo4d/base2t/V072Tong.java @@ -7,6 +7,7 @@ package love.distributedrebirth.demo4d.base2t; */ public final class V072Tong implements BaseNumberTyte { + public static int BIT_COUNT = V036Teger.BIT_COUNT * T02PartBinary.LENGTH; private V036Teger[] values = new V036Teger[T02PartBinary.LENGTH]; public V072Tong() { @@ -36,7 +37,7 @@ public final class V072Tong implements BaseNumberTyte { @Override public int getBitCount() { - return T08PartOctal.BIT_COUNT * T12PartUncial.LENGTH * T02PartBinary.LENGTH; + return BIT_COUNT; } @Override diff --git a/core/src/love/distributedrebirth/demo4d/base2t/V144Tocta.java b/core/src/love/distributedrebirth/demo4d/base2t/V144Tocta.java index 5051b381..ecd086fb 100644 --- a/core/src/love/distributedrebirth/demo4d/base2t/V144Tocta.java +++ b/core/src/love/distributedrebirth/demo4d/base2t/V144Tocta.java @@ -7,6 +7,7 @@ package love.distributedrebirth.demo4d.base2t; */ public final class V144Tocta implements BaseNumberTyte { + public static int BIT_COUNT = V072Tong.BIT_COUNT * T02PartBinary.LENGTH; private V072Tong[] values = new V072Tong[T02PartBinary.LENGTH]; public V144Tocta() { @@ -62,7 +63,7 @@ public final class V144Tocta implements BaseNumberTyte { @Override public int getBitCount() { - return T08PartOctal.BIT_COUNT * T12PartUncial.LENGTH * T04PartQuad.LENGTH; + return BIT_COUNT; } @Override diff --git a/core/src/love/distributedrebirth/demo4d/base2t/VŌṁglyph.java b/core/src/love/distributedrebirth/demo4d/base2t/VŌṁglyph.java new file mode 100644 index 00000000..66cd8a83 --- /dev/null +++ b/core/src/love/distributedrebirth/demo4d/base2t/VŌṁglyph.java @@ -0,0 +1,66 @@ +package love.distributedrebirth.demo4d.base2t; + +abstract public class VŌṁglyph & BaseNumber> implements BaseNumber { + + private V144Tocta[] values; + private int valuesLength; + private byte fractalLevel; + + public VŌṁglyph(byte fractalLevel) { + this.fractalLevel = fractalLevel; + this.valuesLength = resolveFractalLevel(fractalLevel); + this.values = new V144Tocta[valuesLength]; + } + + abstract protected int resolveFractalLevel(byte level); + + public final byte getFractalLevel() { + return fractalLevel; + } + + public final int getValuesLength() { + return valuesLength; + } + + private final int validatePartRequest(int part) { + if (part < 0) { + throw new IllegalArgumentException("Requested part is negative"); + } + if (part > valuesLength) { + throw new IllegalArgumentException("Requested part exceeds fractal storage"); + } + return part; + } + + public final V144Tocta getValue(int part) { + return values[validatePartRequest(part)]; + } + + public final void setValue(int part, V144Tocta value) { + values[validatePartRequest(part)] = value; + } + + abstract protected V toCloneFractal(byte level); + + @Override + public final V toClone() { + V result = toCloneFractal(getFractalLevel()); + T08PartOctalBaseIterator clonedOctals = cloneIterator(); + for (int i=0;i { // 0th = 1 * V144Tocta (1) // 1th = 1+3 * V144Tocta (4) // 2th = 1+3+6 * V144Tocta (10) // 3th = 1+3+6+14 * V144Tocta (24) // etc + + public VŌṁglyphDiamond(byte level) { + super(level); + } + + protected int resolveFractalLevel(byte level) { + // TODO + return level; + } + + @Override + protected VŌṁglyphDiamond toCloneFractal(byte level) { + return new VŌṁglyphDiamond(level); + } } diff --git a/core/src/love/distributedrebirth/demo4d/base2t/VŌṁglyphHyperStar.java b/core/src/love/distributedrebirth/demo4d/base2t/VŌṁglyphHyperStar.java index 281bb326..c7079537 100644 --- a/core/src/love/distributedrebirth/demo4d/base2t/VŌṁglyphHyperStar.java +++ b/core/src/love/distributedrebirth/demo4d/base2t/VŌṁglyphHyperStar.java @@ -1,9 +1,23 @@ package love.distributedrebirth.demo4d.base2t; -public class VŌṁglyphHyperStar { +public class VŌṁglyphHyperStar extends VŌṁglyph { // 0th = V144Tocta // 1th = 5 * V144Tocta // 2th = 5 * 12 * V144Tocta // etc -} + + public VŌṁglyphHyperStar(byte level) { + super(level); + } + + protected int resolveFractalLevel(byte level) { + // TODO + return level; + } + + @Override + protected VŌṁglyphHyperStar toCloneFractal(byte level) { + return new VŌṁglyphHyperStar(level); + } +} \ No newline at end of file