mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-26 05:14:32 -04:00
Debug option: simulate game until certain turn (#1812)
This commit is contained in:
parent
7577655264
commit
58fa5d6dd5
@ -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 */
|
/** For when you need to test something in an advanced game and don't have time to faff around */
|
||||||
val superchargedForDebug = false
|
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
|
var rewriteTranslationFiles = false
|
||||||
|
|
||||||
lateinit var worldScreen: WorldScreen
|
lateinit var worldScreen: WorldScreen
|
||||||
|
@ -80,7 +80,9 @@ class GameInfo {
|
|||||||
|
|
||||||
switchTurn()
|
switchTurn()
|
||||||
|
|
||||||
while(thisPlayer.playerType==PlayerType.AI){
|
while (thisPlayer.playerType == PlayerType.AI
|
||||||
|
|| UncivGame.Current.simulateUntilTurnForDebug > turns
|
||||||
|
) {
|
||||||
if(thisPlayer.isBarbarian() || !thisPlayer.isDefeated()) {
|
if(thisPlayer.isBarbarian() || !thisPlayer.isDefeated()) {
|
||||||
NextTurnAutomation().automateCivMoves(thisPlayer)
|
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",
|
Assert.assertTrue("This test will only pass if the game is not run with debug modes",
|
||||||
!game.superchargedForDebug
|
!game.superchargedForDebug
|
||||||
&& !game.viewEntireMapForDebug
|
&& !game.viewEntireMapForDebug
|
||||||
&& !game.rewriteTranslationFiles)
|
&& !game.rewriteTranslationFiles
|
||||||
|
&& game.simulateUntilTurnForDebug <= 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
// If there's a unit that obsoletes with no upgrade then when it obsoletes
|
// If there's a unit that obsoletes with no upgrade then when it obsoletes
|
||||||
|
Loading…
x
Reference in New Issue
Block a user