mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-21 20:18:28 +07:00
Fix water adjacency test
This commit is contained in:
parent
496b76e2ae
commit
565653c3f0
@ -19,7 +19,7 @@ class FreshWaterTests {
|
||||
companion object {
|
||||
@Suppress("SpellCheckingInspection")
|
||||
private const val testingMap = "H4sIAAAAAAAA/52SwU7DMAyGX6UPkB5WxMVHBhOHSqCBdpl6CKqh1tKmit3REvXdSdVb17GIS6Qkn//f+WNf6/ZVO12joGPwMrQIT3Urgwo3b/SD4J0uqWPI1DeVUsG9qpC+KoE71YQ62HYsth7Vh2bcdwYZBbZ0Tg5Jmhx0Q8boUQkZzIkFjn7i3tE5TQ08BtrJqHxrmYRsA76HdKOGsMyKf5ITeJuLEosR6qOYqM7TbHpjtkYqmbc71NI5ZDi+aCYuFgqTwKI+1yfk1TAjjZ7DZy19Npc+8eXXrBfQbWbuIy7auKnoo1yvJFdpfrASxj7HT9nTGR2I63Dli1YbuYxuZ6wtk9aEQy4i5ecZ+o/BWIy/FE5uFvkDAAA="
|
||||
private val shouldHaveFreshWater = setOf(Vector2(-1f,-1f),Vector2(1f,1f),Vector2(-2f,-2f),Vector2(2f,2f),Vector2(-1f,-2f),Vector2(1f,2f),Vector2(2f,0f),Vector2(-2f,0f),Vector2(2f,1f),Vector2(-2f,-1f))
|
||||
private val adjacentToFreshWater = setOf(Vector2(-1f,-1f),Vector2(1f,1f),Vector2(-1f,-2f),Vector2(1f,2f),Vector2(2f,0f),Vector2(-2f,0f),Vector2(2f,1f),Vector2(-2f,-1f))
|
||||
}
|
||||
|
||||
@Before
|
||||
@ -34,7 +34,7 @@ class FreshWaterTests {
|
||||
fun isAdjacentToFreshWater() {
|
||||
for (tile in map.values) {
|
||||
val isFresh = tile.isAdjacentTo(Constants.freshWater)
|
||||
val shouldFresh = tile.position in shouldHaveFreshWater
|
||||
val shouldFresh = tile.position in adjacentToFreshWater
|
||||
Assert.assertFalse("Tile $tile has fresh water but should not", isFresh && !shouldFresh)
|
||||
Assert.assertFalse("Tile $tile should have fresh water but doesn't", !isFresh && shouldFresh)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user