use of platformSpecific.javaTranslation.Resources.Error in project L42 by ElvisResearchGroup.
the class Resources method getRes.
public static Object getRes(String key, int... ks) {
Object o = usedRes.get(key);
if (o == null) {
throw new Error("Invalid resource " + key + " Valid resources are: " + usedRes.keySet());
}
if (!(o instanceof ClassB)) {
return o;
}
int[] newK = pKeys();
int common = 0;
while (common < newK.length && common < ks.length) {
if (newK[common] == ks[common]) {
common++;
} else {
break;
}
}
int shift = newK.length - common;
int padding = ks.length - common;
if (shift == 0 && padding == 0) {
return o;
}
List<Ast.C> csPadding = new ArrayList<>();
for (int i = 0; i < padding; i++) {
csPadding.add(C.of("Padding" + i));
}
ClassB cb = (ClassB) FromInClass.of((ClassB) o, Path.outer(shift, csPadding));
//Configuration.typeSystem.computeStage(p, cb);
return cb;
}