MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / asMap_set

Method asMap_set

src/main/java/field/graphics/Shader.java:491–517  ·  view source on GitHub ↗
(String p, Object o)

Source from the content-addressed store, hash-verified

489 e.printStackTrace();
490 }
491 }
492
493 @Override
494 @HiddenInAutocomplete
495 public Object asMap_set(String p, Object o) {
496 Object fo = Conversions.convert(o, Supplier.class);
497 if (fo instanceof Supplier) return getDefaultBundle().set(p, (Supplier) fo);
498 if (fo instanceof InvocationHandler) {
499 return getDefaultBundle().set(p, () -> {
500 try {
501 return ((InvocationHandler) fo).invoke(fo, supplier_get, nothing);
502 } catch (Throwable throwable) {
503 throwable.printStackTrace();
504 }
505 return null;
506 });
507 }
508 if (Uniform.isAccepableInstance(fo)) return getDefaultBundle().set(p, () -> fo);
509
510 if (o instanceof OffersUniform) {
511 getDefaultBundle().set(p, () -> ((OffersUniform) o).getUniform());
512 // fall through -- connect things as well as set them as uniforms
513 }
514
515 if (o instanceof TransformFeedback) // needs relinking
516 GraphicsContext.allGraphicsContexts.stream().map(x -> x.lookup(this)).filter(x -> x != null).forEach(x -> ((State) x).work = true);
517
518 return super.asMap_set(p, o);
519 }
520

Callers

nothing calls this directly

Calls 11

convertMethod · 0.95
isAccepableInstanceMethod · 0.95
getDefaultBundleMethod · 0.80
setMethod · 0.65
getUniformMethod · 0.65
asMap_setMethod · 0.65
invokeMethod · 0.45
forEachMethod · 0.45
mapMethod · 0.45
streamMethod · 0.45
lookupMethod · 0.45

Tested by

no test coverage detected