Merge pull request #10717 from Nightfirecat/fix-hot-cold-same-temperature-narrowing

HotColdSolver: Add same-temperature solution narrowing
This commit is contained in:
Adam
2020-02-08 18:11:03 -05:00
committed by GitHub
2 changed files with 27 additions and 6 deletions

View File

@@ -102,8 +102,10 @@ public class HotColdSolver
possibleLocations.removeIf(entry -> isFirstPointCloserRect(lastWorldPoint, worldPoint, entry.getRect()));
break;
case SAME:
// I couldn't figure out a clean implementation for this case
// not necessary for quickly determining final location
// eliminate spots which are absolutely colder or warmer (as they would not yield a SAME temperature change)
possibleLocations.removeIf(entry ->
isFirstPointCloserRect(worldPoint, lastWorldPoint, entry.getRect())
|| isFirstPointCloserRect(lastWorldPoint, worldPoint, entry.getRect()));
}
}