mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-10 15:27:27 +07:00
f1ceaa216a
* Initial refactor * Moved checking if a tile has an enemy to a new method * Rewrote getDistanceToEnemyUnit * changed the position of the logic of checking if the enemy is still there * Changed some of the other methods to use the ThreatManager getClosestEnemy() * Added a new getTilesWithEnemyUnitsInDistance method * Added a new getEnemyMilitaryUnitsInDistance method * Converted a few lines to use ThreatManager * Changed Air units to use threat manager * Fixed tileWithEnemy error * distanceToClosestEnemyTiles now clears at the start of every turn * Added blank lines to end of ThreatManager.kt * Renamed tilesInRange to tilesWithEnemyUnitsInRange * Changed ArrayList return to a MutableList * Removed ClosestEnemyTileData being a data class * Improved commenting * Improved commenting2 * getEnemyMilitaryUnitsInDistance now uses a flatMap and moved getDangerousTiles to threat manager * Created a new helper method getEnemyUnitsOnTiles * Renamed clearThreatData to clear * Added shortcut if maxDist is less than or equal to distanceSearched * Fixed distanceWithNoEnemies in getTilesWithEnemyUnitsInDistance * Fixed notFoundDistance being higher than maxDistance when takeLargerValues is false * Added some ThreatManager tests * Added some more ThreatManager tests * Removed visible map after use * getTilesWithEnemyUnitsInDistance doesn't search distances <= tileData.distanceSearched (previously was <) * Added 3 more tests --------- Co-authored-by: Yair Morgenstern <yairm210@hotmail.com> |
||
---|---|---|
.. | ||
src/com/unciv | ||
build.gradle.kts |