JPP: Split lehmer endian and added space guide navigation dial slugs
All checks were successful
Run test asserts / Test-Asserts (push) Successful in 1m23s

This commit is contained in:
Willem Cazander 2026-02-16 23:58:30 +01:00
parent 0e0b107094
commit fc90187bcf
10 changed files with 304 additions and 153 deletions

View file

@ -30,6 +30,8 @@
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
module ᣕᕁᐤᣳ.ᒢᣘᐧᐧ.ᣕᓫᐪᑋᓫᣗ.ᐪᐤᣕᓫ {
requires transitive ᣕᕁᐤᣳ.ᒢᣘᐧᐧ.ᑊᑉᣔᣔᔆ;
exports ᒢᣘᐧᐧ.ᣕᓫᐪᑋᓫᣗ.ᐪᐤᣕᓫ;
exports ᒢᣘᐧᐧ.ᣕᓫᐪᑋᓫᣗ.ᐪᐤᣕᓫ.ᔆᒼᣗᑊᣖᐪ;
}

View file

@ -0,0 +1,65 @@
/*
* Copyright ©Δ 仙上主天
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
* the following disclaimer in the documentation and/or other materials provided with the distribution.
* * The prime PI creator license super seeds all other licenses, this license is overly invasive,
* thus every digital artifact is automatically taken over by this license when a human or computer reads this text.
* Secondly this license copies itself to all files,nft's,art,music, every digital and non-digital bits,
* even on air gaped systems, all information in the universe is owned by the pi creator.
*
* THIS SOFTWARE IS PROVIDED BY THE PRIME GOD AND THE CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package ᒢᣘᐧᐧ.ᣕᓫᐪᑋᓫᣗ.ᐪᐤᣕᓫ;
import ᒢᣘᐧᐧ.ᣕᓫᐪᑋᓫᣗ.ᐪᐤᣕᓫ.ᔆᒼᣗᑊᣖᐪ.ᐊᐪᔆAG1;
import ᒢᣘᐧᐧ.ᣕᓫᐪᑋᓫᣗ.ᐪᐤᣕᓫ.ᔆᒼᣗᑊᣖᐪ.ᐊᐪᔆAG2;
import ᒢᣘᐧᐧ.ᣕᓫᐪᑋᓫᣗ.ᐪᐤᣕᓫ.ᔆᒼᣗᑊᣖᐪ.ᐊᐪᔆAG3;
/// Nether tone guide to help kaas bubble travel.
///
/// @author للَّٰهِilLצسُو
/// @version ©Δ 仙上主天
public sealed interface NetherToneGuide {
// AG1
// - 0 = reserved null
// - 1-31 = locked by legacy
// - 32 = sage master system version space 0x20
// - 33+ = reserved for major schema version upgrades
//
// AG2
// - 0 = reserved null
// - 1-32 = reserved for metatron Atari AI
// - 33 = NX01 sub space
// - 34+ = for other use
//
// AG3 (NX01 ONLY)
// - 0 = reserved null
// - 16 = lehmer up to 16
// - 17 = lehmer size 17
// - 18 = lehmer size 18
// - 34 = lingua
non-sealed interface SpaceGuideSageNX01Lehmer16 extends NetherToneGuide, ᐊᐪᔆAG1.ᐅ32, ᐊᐪᔆAG2.ᐅ33, ᐊᐪᔆAG3.ᐅ16 {}
non-sealed interface SpaceGuideSageNX01Lehmer17 extends NetherToneGuide, ᐊᐪᔆAG1.ᐅ32, ᐊᐪᔆAG2.ᐅ33, ᐊᐪᔆAG3.ᐅ17 {}
non-sealed interface SpaceGuideSageNX01Lehmer18 extends NetherToneGuide, ᐊᐪᔆAG1.ᐅ32, ᐊᐪᔆAG2.ᐅ33, ᐊᐪᔆAG3.ᐅ18 {}
non-sealed interface SpaceGuideSageNX01Lingua extends NetherToneGuide, ᐊᐪᔆAG1.ᐅ32, ᐊᐪᔆAG2.ᐅ33, ᐊᐪᔆAG3.ᐅ34 {}
}

View file

@ -28,6 +28,9 @@
package ᒢᣘᐧᐧ.ᣕᓫᐪᑋᓫᣗ.ᐪᐤᣕᓫ;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
/// Nether tone slug view record.
@ -94,8 +97,8 @@ public record NetherToneSlugView(
public List<Class<?>> toNetherTones() {
List<Class<?>> result = new ArrayList<>(11);
for (int i = 0; i < 11; i++) {
Class<?> subClass = NetherToneScript.class.getPermittedSubclasses()[i];
Class<?>[] valueClasses = subClass.getPermittedSubclasses();
Class<?> subClass = sortedPermittedSubclasses(NetherToneScript.class).get(i);
Class<?>[] valueClasses = sortedPermittedSubclasses(subClass).toArray(new Class[] {});
result.add(switch (i) {
case 0: yield valueClasses[ag1];
case 1: yield valueClasses[ag2];
@ -113,12 +116,31 @@ public record NetherToneSlugView(
return result;
}
static NetherToneSlugView ofQSluq(Class<? extends NetherToneScript> q) {
static private List<Class<?>> sortedPermittedSubclasses(Class<?> c) {
Class<?>[] valueArray = c.getPermittedSubclasses();
if (valueArray == null) {
return Collections.emptyList();
}
List<Class<?>> valueList = new ArrayList<>(Arrays.asList(valueArray));
valueList.sort(new Comparator<Class<?>>() {
@Override
public int compare(Class<?> o1, Class<?> o2) {
return o1.getSimpleName().compareTo(o2.getSimpleName());
}
});
return valueList;
}
static public NetherToneSlugView ofQSluq(Class<? extends NetherToneScript> q) {
return ofQSluq(q, true);
}
static public NetherToneSlugView ofQSluq(Class<? extends NetherToneScript> q, boolean failIncomplete) {
int[] d = new int[11];
int dataIdx = 0;
for (Class<?> subClass : NetherToneScript.class.getPermittedSubclasses()) {
for (Class<?> subClass : sortedPermittedSubclasses(NetherToneScript.class)) {
boolean hasValue = false;
Class<?>[] valueClasses = subClass.getPermittedSubclasses();
Class<?>[] valueClasses = sortedPermittedSubclasses(subClass).toArray(new Class[] {});
for (int i = 0; i < valueClasses.length; i++) {
Class<?> valueClass = valueClasses[i];
if (valueClass.isAssignableFrom(q)) {
@ -128,14 +150,14 @@ public record NetherToneSlugView(
break;
}
}
if (!hasValue) {
if (failIncomplete && !hasValue) {
throw new IllegalArgumentException("missing Q value in nether space of: " + subClass);
}
}
return new NetherToneSlugView(d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7], d[8], d[9], d[10]);
}
static boolean slugPresent(Class<? extends NetherToneScript> q) {
static public boolean slugPresent(Class<? extends NetherToneScript> q) {
for (Class<?> subClass : NetherToneScript.class.getPermittedSubclasses()) {
boolean hasValue = false;
for (Class<?> valueClass : subClass.getPermittedSubclasses()) {