mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-05 15:59:50 +07:00
Debug option: simulate game until certain turn (#1812)
This commit is contained in:
@ -41,6 +41,12 @@ class UncivGame(
|
||||
/** For when you need to test something in an advanced game and don't have time to faff around */
|
||||
val superchargedForDebug = false
|
||||
|
||||
/** Simulate until this turn on the first "Next turn" button press.
|
||||
* Does not update World View changes until finished.
|
||||
* Set to 0 to disable.
|
||||
*/
|
||||
val simulateUntilTurnForDebug: Int = 0
|
||||
|
||||
var rewriteTranslationFiles = false
|
||||
|
||||
lateinit var worldScreen: WorldScreen
|
||||
|
@ -80,7 +80,9 @@ class GameInfo {
|
||||
|
||||
switchTurn()
|
||||
|
||||
while(thisPlayer.playerType==PlayerType.AI){
|
||||
while (thisPlayer.playerType == PlayerType.AI
|
||||
|| UncivGame.Current.simulateUntilTurnForDebug > turns
|
||||
) {
|
||||
if(thisPlayer.isBarbarian() || !thisPlayer.isDefeated()) {
|
||||
NextTurnAutomation().automateCivMoves(thisPlayer)
|
||||
|
||||
|
@ -39,7 +39,8 @@ class BasicTests {
|
||||
Assert.assertTrue("This test will only pass if the game is not run with debug modes",
|
||||
!game.superchargedForDebug
|
||||
&& !game.viewEntireMapForDebug
|
||||
&& !game.rewriteTranslationFiles)
|
||||
&& !game.rewriteTranslationFiles
|
||||
&& game.simulateUntilTurnForDebug <= 0)
|
||||
}
|
||||
|
||||
// If there's a unit that obsoletes with no upgrade then when it obsoletes
|
||||
|
Reference in New Issue
Block a user