!7 static SimpleLiveValue output = new(S); static Map hasUpdateMethod = weakHashMap(); static Method baseMethod; static JComponent visualize() { ret centerLabel(makeBold(setFontSize(40, jLiveValueLabel(output)))); } p { baseMethod = findInstanceMethod(getClass(creator(), 'main$Module), 'update); } svoid update { L modules = cast call(creator(), 'onModules); int count = 0; for (O m : modules) { Class c = m.getClass(); Bool hasUpdate = hasUpdateMethod.get(c); if (hasUpdate == null) hasUpdateMethod.put(c, hasUpdate = findMethod(m, 'update) != baseMethod); if (hasUpdate) ++count; } output.set(str(count)); }