-
Notifications
You must be signed in to change notification settings - Fork 398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Save games should save pending purchase selections #11819 #12084
Save games should save pending purchase selections #11819 #12084
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this. I think this is very promising, but I have a few suggestions.
game-app/game-headed/src/main/java/games/strategy/triplea/ui/PurchasePanel.java
Outdated
Show resolved
Hide resolved
@@ -191,6 +197,7 @@ public void performDone() { | |||
} | |||
} | |||
} | |||
getData().setPendingProductionRules(null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're only relying on clearing this from PurchasePanel, it means it won't work if you load a save game from a human player and then change that player to AI and another player to human before starting, since I assume it won't run this code.
If this is moved to PurchaseDelegete, then I think this likely won't have the problem if this is put in end()
. But you should test.
game-app/game-core/src/main/java/games/strategy/engine/data/GameData.java
Outdated
Show resolved
Hide resolved
Hey, just wanted to ask if you saw my review comments and suggestions? I think it would be great to get this improvement landed so let me know if anything I said is unclear. Once you updated the PR, happy to take another look! |
Hello, yes, your recommendations are quite clear to me, I have already managed to implement some of them, I still need to check locally if it will work in all cases. I will try to push the code in 2 days at the latest. |
Signed-off-by: Marek Kurej <[email protected]>
Hi, I'm sorry for waiting.. I tried to implement your suggestions mainly in class PurchaseDelegate.. maybe I should have used GameData.Unlocker as you recommended (in PurchasePanel class), but I was mainly inspired by usage of PoliticsDelegate class in AbstractAi class - where is not used that (un)lock. I hope that it is getting closer to the result we wanted. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this looks reasonable, I think.
game-app/game-core/src/main/java/games/strategy/triplea/delegate/PurchaseDelegate.java
Outdated
Show resolved
Hide resolved
game-app/game-headed/src/main/java/games/strategy/triplea/ui/PurchasePanel.java
Outdated
Show resolved
Hide resolved
game-app/game-headed/src/main/java/games/strategy/triplea/ui/PurchasePanel.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Marek Kurej <[email protected]>
You are right with that condition, I'm gonna remove it. |
Hi, I hope it works, I tried it on several games - I got to the purchase phase and saved the game... reloaded it again from the file and the data was loaded correctly. Then I tried to play the game further and get into another purchase phase to see if saving to file doesn't affect other purchase phases and actually it does not affect them.