gdxapp4d/gdxapp4d-lib-bassboonyd/src/main/java/love/distributedrebirth/bassboon/death/BãßBȍőnCoffinGhostSpellLock.java

60 lines
1.8 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package love.distributedrebirth.bassboon.death;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import ᴶᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᐪᓫᕽᐪ.StringGhostKey;
import ᴶᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public interface BãßBȍőnCoffinGhostSpellLock extends BãßBȍőnCoffinGhostSpell {
BãßBȍőnCoffinGhost LOCK();
static BãßBȍőnCoffinGhostSpellLock castᴼᶠ(BãßBȍőnCoffinGhost death) {
return (BãßBȍőnCoffinGhostSpellLock) death;
}
static BãßBȍőnCoffinGhostSpellLock instanceᴺᵉʷ() {
Function<Map<StringGhostKey,Object>,BãßBȍőnCoffinGhost> keyMaker = v -> {
Map<StringGhostKey,Object> summonedGhosts = new HashMap<>(v);
for (StringGhostKey entity:v.keySet()) {
Object spirit = summonedGhosts.get(entity);
if (spirit instanceof List) {
summonedGhosts.put(entity, Collections.unmodifiableList((List<?>) spirit));
}
if (spirit instanceof Map) {
summonedGhosts.put(entity, Collections.unmodifiableMap((Map<?,?>) spirit));
}
}
return new BãßBȍőnCoffinGhost() {
@Override
public Object GHOST_OBJ(StringGhostKey key) {
return summonedGhosts.get(key);
}
};
};
return new BãßBȍőnCoffinGhostSpellLock() {
private final Map<StringGhostKey,Object> ouijaBoard = new HashMap<>();
@Override
public BãßBȍőnCoffinGhost LOCK() {
return keyMaker.apply(ouijaBoard);
}
@Override
public Object GHOST_OBJ(StringGhostKey key) {
return ouijaBoard.get(key);
}
@Override
public Object PUT_GHOST(StringGhostKey key, Object value) {
return ouijaBoard.put(key, value);
}
};
}
}