MCPcopy Create free account
hub / github.com/Var3D/var3dframe / loadFolderExcept

Method loadFolderExcept

core/src/core/java/var3d/net/center/VGame.java:332–352  ·  view source on GitHub ↗
(Class<T> type, Class<?> R_Classs, String... excepts)

Source from the content-addressed store, hash-verified

330 private HashSet<String> hashSet = new HashSet<>();
331
332 public <T> void loadFolderExcept(Class<T> type, Class<?> R_Classs, String... excepts) {
333 for (String name : excepts) {
334 hashSet.add(name);
335 }
336 Class innerClazz[] = R_Classs.getDeclaredClasses();
337 if (innerClazz.length > 0) loadFolderToPack(innerClazz);
338 Field[] fields = R_Classs.getDeclaredFields();
339 for (Field field : fields) {
340 if (field.getModifiers() == 9) {
341 try {
342 String path = (String) field.get(null);
343 if (!hashSet.contains(path)) {
344 load(type, path);
345 }
346 } catch (IllegalAccessException e) {
347 e.printStackTrace();
348 }
349 }
350 }
351 hashSet.clear();
352 }
353
354 /**
355 * 加载文件夹里的图片并合成到大图,自动排除非jpg和png资源以及排除参数指定的任意资源

Callers

nothing calls this directly

Calls 3

loadFolderToPackMethod · 0.95
loadMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected