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

Method advance

src/main/java/fieldbox/boxes/plugins/Layout.java:96–114  ·  view source on GitHub ↗
(Box b, BiFunction<Rect, Rect, Rect> advance)

Source from the content-addressed store, hash-verified

94
95
96 public Box advance(Box b, BiFunction<Rect, Rect, Rect> advance) {
97 Rect R = b.properties.get(Box.frame);
98 boolean repeat = false;
99 do {
100 repeat = false;
101 for (Rect rr : r.values()) {
102 if (rr==null) continue;
103 if (overlaps(rr, R)) {
104 R = advance.apply(rr, R);
105 repeat = true;
106 break;
107 }
108 }
109 } while (repeat);
110
111 b.properties.put(Box.frame, R);
112 r.put(b.properties.getOrConstruct(IO.id), R);
113 return b;
114 }
115
116 public Box advance(Box b, BiFunction<Rect, Rect, Rect> advance, float maxTravel, BiFunction<Rect, Rect, Rect> andThen) {
117 Rect R = b.properties.get(Box.frame);

Callers 4

rightMethod · 0.95
leftMethod · 0.95
downMethod · 0.95
upMethod · 0.95

Calls 6

overlapsMethod · 0.95
duplicateMethod · 0.95
getMethod · 0.65
applyMethod · 0.65
putMethod · 0.45
getOrConstructMethod · 0.45

Tested by

no test coverage detected