Unciv/core
WhoIsJohannes fadeaafc75
Various performance improvements (#9296)
* Move caches for passThrough and movementCost into the parent method.

* Reuse path calculated for reaching enemy city if still far away instead of recalculating it for the "landing tile".

* Cache getDistanceToTilesWithinTurn by removing tilesToIgnore from the call and doing that filtering later. Also simplify caller side with some transformations around differences for the first iteration and subsequent iterations.

* Check whether a player is spectator by comparing their civName directly with the Constant rather than going through the lazily initialized property of the nation. This is significantly faster (10x ?) and we're calling this method a lot (tens of millions of times).

Also check whether a tile is explored directly on the tile, not the other way round.

* Revert "Cache getDistanceToTilesWithinTurn by removing tilesToIgnore from the call and doing that filtering later. Also simplify caller side with some transformations around differences for the first iteration and subsequent iterations."

This reverts commit f75ce00d83.

* Simplify UnitMovement.getShortestPath
2023-05-01 07:35:41 +03:00
..
src/com/unciv Various performance improvements (#9296) 2023-05-01 07:35:41 +03:00
build.gradle.kts