(Rect was, Rect now)
| 136 | off(off); |
| 137 | on(on); |
| 138 | skipForward(skipForward); |
| 139 | skipBackward(skipBackward); |
| 140 | |
| 141 | } |
| 142 | */ |
| 143 | protected void perform(Rect was, Rect now) { |
| 144 | |
| 145 | Map<Box, Double> previousMapping = LocalTime.Companion.growTimeFor(null, population().filter(x -> x.properties.get(frame).y>topLimit && x.properties.get(frame).y<bottomLimit).filter(x -> x.properties.get(frame).intersectsX(was.x)).collect(Collectors.toSet()), was.x); |
| 146 | previousMapping.entrySet().removeIf(m -> !m.getKey().properties.get(frame).intersectsX(m.getValue())); |
| 147 | Map<Box, Double> currentMapping = LocalTime.Companion.growTimeFor(null, population().filter(x -> x.properties.get(frame).y>topLimit && x.properties.get(frame).y<bottomLimit).filter(x -> x.properties.get(frame).intersectsX(now.x)).collect(Collectors.toSet()), now.x); |
| 148 | currentMapping.entrySet().removeIf(m -> !m.getKey().properties.get(frame).intersectsX(m.getValue())); |
| 149 | |
| 150 | Set<Box> off = new LinkedHashSet<>(previousMapping.keySet()); |
| 151 | off.removeAll(currentMapping.keySet()); |
| 152 | Set<Box> on = new LinkedHashSet<>(currentMapping.keySet()); |
| 153 | on.removeAll(previousMapping.keySet()); |
| 154 | |
| 155 | |
| 156 | // Stream<Box> off = population().filter(x -> x.properties.get(frame).intersectsX(was.x)) |
| 157 | // .filter(x -> !x.properties.get(frame) |
| 158 | // .intersectsX(now.x)); |
| 159 | // Stream<Box> on = population().filter(x -> !x.properties.get(frame).intersectsX(was.x)) |
| 160 | // .filter(x -> x.properties.get(frame) |
| 161 | // .intersectsX(now.x)); |
| 162 | |
| 163 | Set<Box> skipForward = new LinkedHashSet<>(currentMapping.keySet()); |
| 164 | skipForward.retainAll(previousMapping.keySet()); |
| 165 | skipForward.removeIf(x -> !x.properties.get(frame).inside(previousMapping.get(x).floatValue(), currentMapping.get(x).floatValue())); |
| 166 | |
| 167 | // Stream<Box> skipForward = population().filter(x -> x.properties.get(frame) |
| 168 | // .inside(was.x, now.x)); |
| 169 | |
| 170 | |
| 171 | // Stream<Box> skipBackward = population().filter(x -> x.properties.get(frame).inside(now.x, was.x)); |
| 172 | this.currentMapping = currentMapping; |
| 173 | this.currentMappingAtTime = now.x; |
| 174 | |
| 175 | off(off); |
| 176 | on(on, currentMapping); |
| 177 | skipForward(skipForward, currentMapping); |
| 178 | // skipBackward(skipBackward); |
| 179 |
no test coverage detected