Closed wichern closed 1 year ago
@Flamefire Thank you very much for your review! I tried to fix all your findings.
Tomorrow, I'll check if it is possible to save and load an ai battle.
Starting an AI-Battle from a savegame seems to work.
The provided AI players (--ai
) have no effect in that case, except when none is given at all. In the latter case, player 0 will be played by the human player.
I did not see an existing UT for QuickStartGame()
. How should I handle missing code coverage? Would you like me to create a UT for it?
I did not see an existing UT for
QuickStartGame()
. How should I handle missing code coverage? Would you like me to create a UT for it?
As that method is not critical I'm OK with missing coverage for that, as we have the review at least. If you can come up with a test then feel free. However I imagine that this would be very complicated due to the client, server, windowmanager and desktop being involved (so it's rather an integration test). Hence the idea to factor out the AI name parsing to have at least that tested, and skip the rest which "should work" after inspection ;-)
This change allows to quick-start into an AI-only game.
Example:
./bin/s25client -m share/s25rttr/RTTR/MAPS/NEW/Bagel5.SWD --ai aijh --ai aijh --ai dummy
Will result in
Implementation: This change adds a new program option (
--ai
) and extendsQuickStartGame()
. In order to have the requested AIs ready indskGameLobby
, the AI configuration is stored inGameClient
. InGameClient::GameLoaded()
we callToggleHumanAIPlayer()
to turn the human player into an AI as well.Notes: There are no further limitations. The user can still add buildings and roads.