fun with duytschen i18n of api

This commit is contained in:
Willem Cazander 2022-10-22 02:55:03 +02:00
parent d26afc79c3
commit 9853e44ee6
5 changed files with 147 additions and 11 deletions

View file

@ -14,6 +14,7 @@ import love.distributedrebirth.bassboon.clazz.pirate.BãßBȍőnPirateLoader;
import love.distributedrebirth.bassboon.clazz.pirate.BãßBȍőnꝐŕḯṿª;
import love.distributedrebirth.bassboon.clazz.pirate.BãßBȍőnꝐŕḯṿªḕ響ᴼᶠ;
import love.distributedrebirth.bassboon.death.BãßBȍőnCoffin;
import love.distributedrebirth.bassboon.death.BãßBȍőnCoffinDuytschenᵗˣᵗ;
import love.distributedrebirth.bassboon.death.BãßBȍőnCoffinGhost;
import love.distributedrebirth.bassboon.death.BãßBȍőnCoffinGhostSpell;
import love.distributedrebirth.bassboon.death.BãßBȍőnCoffinGhostSpellLock;
@ -60,6 +61,9 @@ public interface Bãß {
protected static final <T extends BãßBȍőnʸᴰ<T>> BãßBȍőnCoffin 棺ᴼᶠ(BãßBȍőnʸᴰ<T> boon) {
return 挖ᵀᵒ(boon);
}
protected static final <T extends BãßBȍőnʸᴰ<T>, G extends BãßBȍőnCoffinDuytschenᵗˣᵗ> G 棺ᴼᶠ(BãßBȍőnʸᴰ<T> boon, Class<G> duytschen) {
return 挖ᵀᵒ(boon).ₜₒI18Nᵗˣᵗ(duytschen);
}
/**
* Dig To
@ -117,21 +121,21 @@ public interface Bãß {
}
*/
private static final class BȍőnGrave implements BãßBȍőnCoffin {
private final Map<Class<?>,BãßBȍőnCoffinGhost> ghosts;
private final BãßBȍőnSpider spider;
private final Map<Class<? extends BãßBȍőnCoffinDuytschenᵗˣᵗ>,BãßBȍőnCoffinDuytschenᵗˣᵗ> duytschenCoffins = new HashMap<>();
private final Map<Class<?>,BãßBȍőnCoffinGhost> ghosts = new HashMap<>();
private final BãßBȍőnSpider spider = new BãßBȍőnSpider();
private boolean inited = false;
private boolean locked = false;
private BȍőnGrave() {
this.ghosts = new HashMap<>();
this.spider = new BãßBȍőnSpider();
BãßBȍőnCoffinDuytschenᵗˣᵗ.ײₚᵤₜI18Nᵗˣᵗײ(duytschenCoffins, this);
}
private <T extends BãßBȍőnʸᴰ<T>> void init(BãßBȍőnʸᴰ<T> boon) {
if (inited) {
return;
}
BãßBȍőnPirateLoader.INIT_BONE_MAGIC(boon, spider);
BãßBȍőnPirateLoader.INIT_BONE_MAGIC(boon, spider, duytschenCoffins);
inited = true;
}
@ -174,6 +178,15 @@ public interface Bãß {
throw new RuntimeException(e);
}
}
@SuppressWarnings("unchecked")
private <G extends BãßBȍőnCoffinDuytschenᵗˣᵗ> G ₜₒI18Nᵗˣᵗ(Class<G> duytschen) {
G result = (G) duytschenCoffins.get(duytschen);
if (result == null) {
throw new IllegalArgumentException("Unknown duytschen: "+duytschen);
}
return result;
}
}
}