Test framework: simplified AI logic and tests, added usage comments. Devs recommendations:

* in card's code use player.isComputer instead player.isHuman (it help to split Human/AI logic and test both by unit tests);
* usage example: AI hint to skip or auto-calculate choices instead call of real choose dialogs;
* unit tests for Human logic: call normal commands;
* unit tests for AI logic: call aiXXX commands;
This commit is contained in:
Oleg Agafonov 2021-03-07 22:51:58 +04:00
parent 00c7b3753c
commit 2906f86324
22 changed files with 106 additions and 47 deletions

View file

@ -2715,7 +2715,7 @@ public abstract class PlayerImpl implements Player, Serializable {
}
// only humans can use it
if (!targetPlayer.isHuman() && !targetPlayer.isTestMode()) {
if (targetPlayer.isComputer()) {
return false;
}
@ -3866,7 +3866,7 @@ public abstract class PlayerImpl implements Player, Serializable {
}
@Override
public boolean isTestMode() {
public boolean isTestsMode() {
return isTestMode;
}