60 lines
1.8 KiB
Java
60 lines
1.8 KiB
Java
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);
|
||
}
|
||
};
|
||
}
|
||
}
|