From 1bd8e53c6b50fc1f79d3cd49bcda18f606d11867 Mon Sep 17 00:00:00 2001 From: Willem Cazander Date: Thu, 3 Feb 2022 14:21:08 +0100 Subject: [PATCH] start with warp core impl --- .../distributedrebirth/demo4d/Demo4DMain.java | 8 +++ .../base2t/part/warp/TOSWarpCore.java | 54 ++++++++++++++++++- .../numberxd/base2t/part/warp/WarpCipher.java | 8 +-- .../base2t/part/warp/WarpCipherHeart.java | 2 + 4 files changed, 67 insertions(+), 5 deletions(-) diff --git a/core/src/love/distributedrebirth/demo4d/Demo4DMain.java b/core/src/love/distributedrebirth/demo4d/Demo4DMain.java index 510c2939..48ee6488 100644 --- a/core/src/love/distributedrebirth/demo4d/Demo4DMain.java +++ b/core/src/love/distributedrebirth/demo4d/Demo4DMain.java @@ -28,6 +28,7 @@ import love.distributedrebirth.demo4d.screen.ScreenHelp; import love.distributedrebirth.demo4d.screen.ScreenIntro; import love.distributedrebirth.demo4d.screen.ScreenIntroMission; import love.distributedrebirth.demo4d.screen.ScreenUnicode4D; +import love.distributedrebirth.numberxd.base2t.part.warp.TOSWarpCore; import net.spookygames.gdx.nativefilechooser.NativeFileChooser; /** @@ -97,6 +98,13 @@ public class Demo4DMain extends Game { if (args.contains("full-screen")) { Gdx.graphics.setFullscreenMode(Gdx.graphics.getDisplayMode()); } + int fileArgu = args.indexOf("warpcore-load"); + if (fileArgu != -1) { + // TODO: load warpcore + } + if (!args.contains("warpcore-nolock")) { + TOSWarpCore.INSTANCE.BãßLockWarpCipher(); + } } @Override diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/warp/TOSWarpCore.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/warp/TOSWarpCore.java index c389bca8..923d72a4 100644 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/warp/TOSWarpCore.java +++ b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/warp/TOSWarpCore.java @@ -1,8 +1,58 @@ package love.distributedrebirth.numberxd.base2t.part.warp; import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; +import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinOpenʸᴰ; +import love.distributedrebirth.bassboonyd.BãßBȍőnEnumInstanceʸᴰ; +import love.distributedrebirth.numberxd.base2t.BasePartFactory; +import love.distributedrebirth.numberxd.base2t.part.BãßBȍőnPartʸᴰ; @BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") -public class TOSWarpCore { - +public enum TOSWarpCore implements BãßBȍőnEnumInstanceʸᴰ { + + INSTANCE; + + private String armedWarpCipherName; + private String armedWarpCipherDescription; + + public void BãßLockWarpCipher() { + for (int base:BasePartFactory.INSTANCE.BãßBases()) { + for (BãßBȍőnPartʸᴰ part:BasePartFactory.INSTANCE.BãßBuildPartsByBase(base)) { + BãßBȍőnCoffinOpenʸᴰ.class.cast(part.GET_BBC()).LOCK_COFFIN(); + } + } + } + + public WarpCipher BãßSaveWarpCipher() { + WarpCipher warpCore = new WarpCipher(); + if (armedWarpCipherName == null) { + warpCore.setCipherName("default"); + } else { + warpCore.setCipherName(armedWarpCipherName); + } + if (armedWarpCipherDescription == null) { + warpCore.setCipherName("Current active cipher."); + } else { + warpCore.setCipherDescription(armedWarpCipherDescription); + } + for (int base:BasePartFactory.INSTANCE.BãßBases()) { + WarpCipherHeart heart = new WarpCipherHeart(); + BãßBȍőnPartʸᴰ[] bases = BasePartFactory.INSTANCE.BãßBuildPartsByBase(base); + heart.setPartKey(bases[0].BȍőnNaamI18N()); + for (BãßBȍőnPartʸᴰ part:bases) { + WarpCipherHeartCore core = new WarpCipherHeartCore(); + core.setIdentifierTone(part.BȍőnIdentifierTone()); + core.setChinaKey(part.BȍőnChinaKey()); + core.setChinaValue(part.BȍőnChinaValue()); + heart.getHeartCores().add(core); + } + warpCore.getCipherHearts().add(heart); + } + return warpCore; + } + + public void BãßLoadWarpCipher(WarpCipher warpCore) { + armedWarpCipherName = warpCore.getCipherName(); + armedWarpCipherDescription = warpCore.getCipherDescription(); + // TODO: load warpcore + } } diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/warp/WarpCipher.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/warp/WarpCipher.java index 5382f627..7caa1f7d 100644 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/warp/WarpCipher.java +++ b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/warp/WarpCipher.java @@ -1,5 +1,6 @@ package love.distributedrebirth.numberxd.base2t.part.warp; +import java.util.ArrayList; import java.util.List; import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; @@ -7,11 +8,12 @@ import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; @BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天") public class WarpCipher { - String cipherName; - String cipherDescription; - List cipherHearts; + private String cipherName; + private String cipherDescription; + private List cipherHearts; public WarpCipher() { + cipherHearts = new ArrayList<>(); } public String getCipherName() { diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/warp/WarpCipherHeart.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/warp/WarpCipherHeart.java index 0234ab1e..e35fb3b6 100644 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/warp/WarpCipherHeart.java +++ b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/part/warp/WarpCipherHeart.java @@ -1,5 +1,6 @@ package love.distributedrebirth.numberxd.base2t.part.warp; +import java.util.ArrayList; import java.util.List; import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ; @@ -11,6 +12,7 @@ public class WarpCipherHeart { private List heartCores; public WarpCipherHeart() { + heartCores = new ArrayList<>(); } public String getPartKey() {