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

Method strobe

src/main/java/field/graphics/Scene.java:57–66  ·  view source on GitHub ↗

utility, takes a consumer and returns a version that runs only once every "count" iterations

(Consumer<T> c, int count)

Source from the content-addressed store, hash-verified

55 */
56
57 static public <T> Consumer<T> strobe(Consumer<T> c, int count) {
58 return new Consumer<T>() {
59 int tick = 0;
60
61 @Override
62 public void accept(T t) {
63 if (tick++ % count == 0) c.accept(t);
64 }
65 };
66 }
67
68 static public Perform perform(int pass, Supplier<Boolean> action) {
69 return new Perform() {

Callers 1

OpenMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected