GUI, table: allow unlimited draft bots amount, fixed computer names in 10+ tables (part of #13701)

This commit is contained in:
Oleg Agafonov 2025-05-31 13:10:03 +04:00 committed by Failure
parent 7318b89236
commit 3c83898929
10 changed files with 40 additions and 27 deletions

View file

@ -8,15 +8,19 @@ package mage.players;
* @author IGOUDT
*/
public enum PlayerType {
HUMAN("Human"),
COMPUTER_DRAFT_BOT("Computer - draftbot"),
COMPUTER_MONTE_CARLO("Computer - monte carlo"),
COMPUTER_MAD("Computer - mad");
HUMAN("Human", false, true),
COMPUTER_DRAFT_BOT("Computer - draftbot", true, false),
COMPUTER_MONTE_CARLO("Computer - monte carlo", true, true),
COMPUTER_MAD("Computer - mad", true, true);
final String description;
final boolean isAI;
final boolean isWorkablePlayer; // false for draft bots cause it does nothing in real game and just loose a game
PlayerType(String description) {
PlayerType(String description, boolean isAI, boolean isWorkablePlayer) {
this.description = description;
this.isAI = isAI;
this.isWorkablePlayer = isWorkablePlayer;
}
@Override
@ -24,6 +28,14 @@ public enum PlayerType {
return description;
}
public boolean isAI() {
return this.isAI;
}
public boolean isWorkablePlayer() {
return this.isWorkablePlayer;
}
public static PlayerType getByDescription(String description) {
for (PlayerType type : values()) {
if (type.description.equals(description)) {