Renamed base2 factory
This commit is contained in:
parent
dc978272b4
commit
f26163e405
|
@ -25,9 +25,9 @@ import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinʸᴰ;
|
||||||
import love.distributedrebirth.bassboonyd.BãßBȍőnPackageInfoʸᴰ;
|
import love.distributedrebirth.bassboonyd.BãßBȍőnPackageInfoʸᴰ;
|
||||||
|
|
||||||
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
|
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
|
||||||
@BãßBȍőnClassInfoʸᴰ(name = "BasePartFactory", purpose = "Factory to access the bases.")
|
@BãßBȍőnClassInfoʸᴰ(name = "Base2PartsFactory", purpose = "Factory to access the bases.")
|
||||||
@BãßBȍőnPackageInfoʸᴰ(name = "love.distributedrebirth.numberxd")
|
@BãßBȍőnPackageInfoʸᴰ(name = "love.distributedrebirth.numberxd")
|
||||||
public enum BasePartFactory implements DefaultEnumInstanceᴶᴹˣ<BasePartFactory, MBeanStoreKeyᴶᴹˣ> {
|
public enum Base2PartsFactory implements DefaultEnumInstanceᴶᴹˣ<Base2PartsFactory, MBeanStoreKeyᴶᴹˣ> {
|
||||||
|
|
||||||
INSTANCE;
|
INSTANCE;
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ public enum BasePartFactory implements DefaultEnumInstanceᴶᴹˣ<BasePartFacto
|
||||||
private final BãßBȍőnCoffinOpenʸᴰ<MBeanStoreKeyᴶᴹˣ> BBC = BãßBȍőnCoffinOpenʸᴰ.newInstance();
|
private final BãßBȍőnCoffinOpenʸᴰ<MBeanStoreKeyᴶᴹˣ> BBC = BãßBȍőnCoffinOpenʸᴰ.newInstance();
|
||||||
public BãßBȍőnCoffinʸᴰ<MBeanStoreKeyᴶᴹˣ> GET_BBC() { return BBC; }
|
public BãßBȍőnCoffinʸᴰ<MBeanStoreKeyᴶᴹˣ> GET_BBC() { return BBC; }
|
||||||
|
|
||||||
private BasePartFactory() {
|
private Base2PartsFactory() {
|
||||||
BBC.BOON_INIT(this);
|
BBC.BOON_INIT(this);
|
||||||
BȍőnJmxInit(MBeanStoreKeyᴶᴹˣ.JMX);
|
BȍőnJmxInit(MBeanStoreKeyᴶᴹˣ.JMX);
|
||||||
baseT02Reads = BȍőnJmxInitGuageCounter(MBeanStoreKeyᴶᴹˣ.JMX, "baseT02Reads");
|
baseT02Reads = BȍőnJmxInitGuageCounter(MBeanStoreKeyᴶᴹˣ.JMX, "baseT02Reads");
|
|
@ -13,7 +13,7 @@ import love.distributedrebirth.bassboonyd.jmx.MBeanStoreKeyᴶᴹˣ;
|
||||||
import love.distributedrebirth.bassboonyd.jmx.DefaultEnumInstanceᴶᴹˣ;
|
import love.distributedrebirth.bassboonyd.jmx.DefaultEnumInstanceᴶᴹˣ;
|
||||||
import love.distributedrebirth.bassboonyd.jmx.GuageCounterᴶᴹˣ;
|
import love.distributedrebirth.bassboonyd.jmx.GuageCounterᴶᴹˣ;
|
||||||
import love.distributedrebirth.bassboonyd.jmx.StringAttributeᴶᴹˣ;
|
import love.distributedrebirth.bassboonyd.jmx.StringAttributeᴶᴹˣ;
|
||||||
import love.distributedrebirth.numberxd.base2t.BasePartFactory;
|
import love.distributedrebirth.numberxd.base2t.Base2PartsFactory;
|
||||||
import love.distributedrebirth.numberxd.base2t.part.BãßBȍőnPartKeyʸᴰ;
|
import love.distributedrebirth.numberxd.base2t.part.BãßBȍőnPartKeyʸᴰ;
|
||||||
import love.distributedrebirth.numberxd.base2t.part.BãßBȍőnPartʸᴰ;
|
import love.distributedrebirth.numberxd.base2t.part.BãßBȍőnPartʸᴰ;
|
||||||
|
|
||||||
|
@ -49,8 +49,8 @@ public enum TOSWarpCore implements DefaultEnumInstanceᴶᴹˣ<TOSWarpCore,MBean
|
||||||
|
|
||||||
public void BãßLockWarpCipher() {
|
public void BãßLockWarpCipher() {
|
||||||
armedWarpCipherLock.setValueBoolean(true);
|
armedWarpCipherLock.setValueBoolean(true);
|
||||||
for (int base:BasePartFactory.INSTANCE.BãßBases()) {
|
for (int base:Base2PartsFactory.INSTANCE.BãßBases()) {
|
||||||
for (BãßBȍőnPartʸᴰ<?> part:BasePartFactory.INSTANCE.BãßBuildPartsByBase(base)) {
|
for (BãßBȍőnPartʸᴰ<?> part:Base2PartsFactory.INSTANCE.BãßBuildPartsByBase(base)) {
|
||||||
BãßBȍőnCoffinOpenʸᴰ.class.cast(part.GET_BBC()).LOCK_COFFIN();
|
BãßBȍőnCoffinOpenʸᴰ.class.cast(part.GET_BBC()).LOCK_COFFIN();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -61,9 +61,9 @@ public enum TOSWarpCore implements DefaultEnumInstanceᴶᴹˣ<TOSWarpCore,MBean
|
||||||
WaterCipher warpCipher = new WaterCipher();
|
WaterCipher warpCipher = new WaterCipher();
|
||||||
warpCipher.setName(armedWarpWaterName.getValueString());
|
warpCipher.setName(armedWarpWaterName.getValueString());
|
||||||
warpCipher.setDescription(armedWarpWaterDesc.getValueString());
|
warpCipher.setDescription(armedWarpWaterDesc.getValueString());
|
||||||
for (int base:BasePartFactory.INSTANCE.BãßBases()) {
|
for (int base:Base2PartsFactory.INSTANCE.BãßBases()) {
|
||||||
WaterCipherHeart heart = new WaterCipherHeart();
|
WaterCipherHeart heart = new WaterCipherHeart();
|
||||||
BãßBȍőnPartʸᴰ<?>[] bases = BasePartFactory.INSTANCE.BãßBuildPartsByBase(base);
|
BãßBȍőnPartʸᴰ<?>[] bases = Base2PartsFactory.INSTANCE.BãßBuildPartsByBase(base);
|
||||||
heart.setBass(bases[0].BãßInstances().length);
|
heart.setBass(bases[0].BãßInstances().length);
|
||||||
for (BãßBȍőnPartʸᴰ<?> part:bases) {
|
for (BãßBȍőnPartʸᴰ<?> part:bases) {
|
||||||
WaterCipherHeartTone tone = new WaterCipherHeartTone();
|
WaterCipherHeartTone tone = new WaterCipherHeartTone();
|
||||||
|
@ -85,7 +85,7 @@ public enum TOSWarpCore implements DefaultEnumInstanceᴶᴹˣ<TOSWarpCore,MBean
|
||||||
Map<String,String> chinaKey = new HashMap<>();
|
Map<String,String> chinaKey = new HashMap<>();
|
||||||
Map<String,String> chinaValue = new HashMap<>();
|
Map<String,String> chinaValue = new HashMap<>();
|
||||||
for (WaterCipherHeart heart:warpBucket.theWater().getCipherHearts()) {
|
for (WaterCipherHeart heart:warpBucket.theWater().getCipherHearts()) {
|
||||||
BãßBȍőnPartʸᴰ<?>[] bases = BasePartFactory.INSTANCE.BãßBuildPartsByBase(heart.getBass());
|
BãßBȍőnPartʸᴰ<?>[] bases = Base2PartsFactory.INSTANCE.BãßBuildPartsByBase(heart.getBass());
|
||||||
Map<String, BãßBȍőnPartʸᴰ<?>> baseParts = new HashMap<>();
|
Map<String, BãßBȍőnPartʸᴰ<?>> baseParts = new HashMap<>();
|
||||||
for (BãßBȍőnPartʸᴰ<?> base:bases) {
|
for (BãßBȍőnPartʸᴰ<?> base:bases) {
|
||||||
baseParts.put(base.BȍőnNaam(), base);
|
baseParts.put(base.BȍőnNaam(), base);
|
||||||
|
@ -109,7 +109,7 @@ public enum TOSWarpCore implements DefaultEnumInstanceᴶᴹˣ<TOSWarpCore,MBean
|
||||||
armedWarpWaterName.setValueString(warpBucket.theWater().getName());
|
armedWarpWaterName.setValueString(warpBucket.theWater().getName());
|
||||||
armedWarpWaterDesc.setValueString(warpBucket.theWater().getDescription());
|
armedWarpWaterDesc.setValueString(warpBucket.theWater().getDescription());
|
||||||
for (WaterCipherHeart heart:warpBucket.theWater().getCipherHearts()) {
|
for (WaterCipherHeart heart:warpBucket.theWater().getCipherHearts()) {
|
||||||
BãßBȍőnPartʸᴰ<?>[] bases = BasePartFactory.INSTANCE.BãßBuildPartsByBase(heart.getBass());
|
BãßBȍőnPartʸᴰ<?>[] bases = Base2PartsFactory.INSTANCE.BãßBuildPartsByBase(heart.getBass());
|
||||||
Map<String, BãßBȍőnPartʸᴰ<?>> baseParts = new HashMap<>();
|
Map<String, BãßBȍőnPartʸᴰ<?>> baseParts = new HashMap<>();
|
||||||
for (BãßBȍőnPartʸᴰ<?> base:bases) {
|
for (BãßBȍőnPartʸᴰ<?> base:bases) {
|
||||||
baseParts.put(base.BȍőnNaam(), base);
|
baseParts.put(base.BȍőnNaam(), base);
|
||||||
|
|
|
@ -14,7 +14,7 @@ public class BasePartFactoryTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSupportedBases() {
|
public void testSupportedBases() {
|
||||||
int[] bases = BasePartFactory.INSTANCE.BãßBases();
|
int[] bases = Base2PartsFactory.INSTANCE.BãßBases();
|
||||||
Assertions.assertNotNull(bases);
|
Assertions.assertNotNull(bases);
|
||||||
Assertions.assertTrue(bases.length > 1);
|
Assertions.assertTrue(bases.length > 1);
|
||||||
Assertions.assertTrue(bases.length < 100);
|
Assertions.assertTrue(bases.length < 100);
|
||||||
|
@ -23,8 +23,8 @@ public class BasePartFactoryTest {
|
||||||
@Test
|
@Test
|
||||||
public void testGlobalChinaKeyMap() {
|
public void testGlobalChinaKeyMap() {
|
||||||
Map<String,String> global = new HashMap<>();
|
Map<String,String> global = new HashMap<>();
|
||||||
for (int base:BasePartFactory.INSTANCE.BãßBases()) {
|
for (int base:Base2PartsFactory.INSTANCE.BãßBases()) {
|
||||||
for (BãßBȍőnPartʸᴰ<?> part:BasePartFactory.INSTANCE.BãßBuildPartsByBase(base)) {
|
for (BãßBȍőnPartʸᴰ<?> part:Base2PartsFactory.INSTANCE.BãßBuildPartsByBase(base)) {
|
||||||
Assertions.assertFalse(global.containsKey(part.BȍőnChinaKey()), "key: "+part.BȍőnChinaKey());
|
Assertions.assertFalse(global.containsKey(part.BȍőnChinaKey()), "key: "+part.BȍőnChinaKey());
|
||||||
global.put(part.BȍőnChinaKey(), part.BȍőnChinaValue());
|
global.put(part.BȍőnChinaKey(), part.BȍőnChinaValue());
|
||||||
}
|
}
|
||||||
|
@ -35,8 +35,8 @@ public class BasePartFactoryTest {
|
||||||
@Test
|
@Test
|
||||||
public void testGlobalChinaValueMap() {
|
public void testGlobalChinaValueMap() {
|
||||||
Map<String,String> global = new HashMap<>();
|
Map<String,String> global = new HashMap<>();
|
||||||
for (int base:BasePartFactory.INSTANCE.BãßBases()) {
|
for (int base:Base2PartsFactory.INSTANCE.BãßBases()) {
|
||||||
for (BãßBȍőnPartʸᴰ<?> part:BasePartFactory.INSTANCE.BãßBuildPartsByBase(base)) {
|
for (BãßBȍőnPartʸᴰ<?> part:Base2PartsFactory.INSTANCE.BãßBuildPartsByBase(base)) {
|
||||||
Assertions.assertFalse(global.containsKey(part.BȍőnChinaValue()));
|
Assertions.assertFalse(global.containsKey(part.BȍőnChinaValue()));
|
||||||
global.put(part.BȍőnChinaValue(), part.BȍőnChinaValue());
|
global.put(part.BȍőnChinaValue(), part.BȍőnChinaValue());
|
||||||
}
|
}
|
||||||
|
@ -48,8 +48,8 @@ public class BasePartFactoryTest {
|
||||||
public void testGlobalToneMap() {
|
public void testGlobalToneMap() {
|
||||||
boolean duplicate = false;
|
boolean duplicate = false;
|
||||||
Map<String,String> global = new HashMap<>();
|
Map<String,String> global = new HashMap<>();
|
||||||
for (int base:BasePartFactory.INSTANCE.BãßBases()) {
|
for (int base:Base2PartsFactory.INSTANCE.BãßBases()) {
|
||||||
for (BãßBȍőnPartʸᴰ<?> part:BasePartFactory.INSTANCE.BãßBuildPartsByBase(base)) {
|
for (BãßBȍőnPartʸᴰ<?> part:Base2PartsFactory.INSTANCE.BãßBuildPartsByBase(base)) {
|
||||||
if (global.containsKey(part.BȍőnDialTone())) {
|
if (global.containsKey(part.BȍőnDialTone())) {
|
||||||
duplicate = true;
|
duplicate = true;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -11,7 +11,7 @@ import imgui.type.ImInt;
|
||||||
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
|
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
|
||||||
import love.distributedrebirth.gdxapp.GDXAppMain;
|
import love.distributedrebirth.gdxapp.GDXAppMain;
|
||||||
import love.distributedrebirth.gdxapp.ImGuiRendererMain;
|
import love.distributedrebirth.gdxapp.ImGuiRendererMain;
|
||||||
import love.distributedrebirth.numberxd.base2t.BasePartFactory;
|
import love.distributedrebirth.numberxd.base2t.Base2PartsFactory;
|
||||||
import love.distributedrebirth.numberxd.base2t.part.BãßBȍőnPartAlt1ʸᴰ;
|
import love.distributedrebirth.numberxd.base2t.part.BãßBȍőnPartAlt1ʸᴰ;
|
||||||
import love.distributedrebirth.numberxd.base2t.part.BãßBȍőnPartAlt2ʸᴰ;
|
import love.distributedrebirth.numberxd.base2t.part.BãßBȍőnPartAlt2ʸᴰ;
|
||||||
import love.distributedrebirth.numberxd.base2t.part.BãßBȍőnPartAlt3ʸᴰ;
|
import love.distributedrebirth.numberxd.base2t.part.BãßBȍőnPartAlt3ʸᴰ;
|
||||||
|
@ -35,14 +35,14 @@ public class SystemBasePartRenderer extends ImGuiRendererMain {
|
||||||
if (ImGui.begin("Base part", widgetOpen)) {
|
if (ImGui.begin("Base part", widgetOpen)) {
|
||||||
|
|
||||||
List<String> bases = new ArrayList<>();
|
List<String> bases = new ArrayList<>();
|
||||||
for (int base:BasePartFactory.INSTANCE.BãßBases()) {
|
for (int base:Base2PartsFactory.INSTANCE.BãßBases()) {
|
||||||
bases.add(Integer.toString(base));
|
bases.add(Integer.toString(base));
|
||||||
}
|
}
|
||||||
String[] items = new String[bases.size()];
|
String[] items = new String[bases.size()];
|
||||||
items = bases.toArray(items);
|
items = bases.toArray(items);
|
||||||
String selectedItem = items[selectedBasePart.get()];
|
String selectedItem = items[selectedBasePart.get()];
|
||||||
Integer baseNumber = Integer.valueOf(selectedItem);
|
Integer baseNumber = Integer.valueOf(selectedItem);
|
||||||
BãßBȍőnPartʸᴰ<?>[] baseParts = BasePartFactory.INSTANCE.BãßBuildPartsByBase(baseNumber);
|
BãßBȍőnPartʸᴰ<?>[] baseParts = Base2PartsFactory.INSTANCE.BãßBuildPartsByBase(baseNumber);
|
||||||
|
|
||||||
ImGui.combo("Base", selectedBasePart, items);
|
ImGui.combo("Base", selectedBasePart, items);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue