mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-04 15:27:50 +07:00
Fixed tests
This commit is contained in:
@ -106,8 +106,8 @@ class MapLandmassGenerator(val ruleset: Ruleset, val randomness: MapGenerationRa
|
||||
}
|
||||
|
||||
private fun createPangaea(tileMap: TileMap) {
|
||||
val elevationSeed = randomness.RNG.nextInt().toDouble()
|
||||
do {
|
||||
val elevationSeed = randomness.RNG.nextInt().toDouble()
|
||||
for (tile in tileMap.values) {
|
||||
var elevation = randomness.getPerlinNoise(tile, elevationSeed)
|
||||
elevation = elevation * (3 / 4f) + getEllipticContinent(tile, tileMap) / 4
|
||||
@ -115,7 +115,7 @@ class MapLandmassGenerator(val ruleset: Ruleset, val randomness: MapGenerationRa
|
||||
}
|
||||
|
||||
tileMap.assignContinents(TileMap.AssignContinentsMode.Reassign)
|
||||
} while (tileMap.continentSizes.values.count { it > 20 } != 1)
|
||||
} while (tileMap.continentSizes.values.count { it > 25 } != 1)
|
||||
|
||||
tileMap.assignContinents(TileMap.AssignContinentsMode.Clear)
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ object UnitActionsPillage {
|
||||
}
|
||||
}
|
||||
|
||||
internal fun getPillageAction(unit: MapUnit): UnitAction? {
|
||||
fun getPillageAction(unit: MapUnit): UnitAction? {
|
||||
val tile = unit.currentTile
|
||||
if (unit.isCivilian() || !tile.canPillageTile() || tile.getOwner() == unit.civInfo) return null
|
||||
return UnitAction(
|
||||
|
@ -7,7 +7,7 @@ import com.unciv.logic.map.tile.RoadStatus
|
||||
import com.unciv.models.ruleset.BeliefType
|
||||
import com.unciv.models.stats.Stats
|
||||
import com.unciv.testing.GdxTestRunner
|
||||
import com.unciv.ui.worldscreen.unit.actions.UnitActions
|
||||
import com.unciv.ui.worldscreen.unit.actions.UnitActionsPillage
|
||||
import org.junit.Assert
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
@ -555,7 +555,7 @@ class GlobalUniquesTests {
|
||||
val unit = game.addUnit("Warrior", civInfo, tile)
|
||||
unit.currentMovement = 2f
|
||||
|
||||
val pillageAction = UnitActions.getPillageAction(unit)
|
||||
val pillageAction = UnitActionsPillage.getPillageAction(unit)
|
||||
pillageAction?.action?.invoke()
|
||||
Assert.assertTrue("Pillaging should transfer gold to the civ", civInfo.gold == 20)
|
||||
Assert.assertTrue("Pillaging should transfer food to the nearest city", cityInfo.population.foodStored == 11)
|
||||
|
Reference in New Issue
Block a user