1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-11 09:11:12 -09:00

* AI: fixed game freezes for cards with different human/computer logic ();

This commit is contained in:
Oleg Agafonov 2019-04-04 09:00:30 +04:00
parent ea92b1f462
commit 238aa7abdc

View file

@ -95,6 +95,11 @@ public class ComputerPlayer extends PlayerImpl implements Player {
protected ComputerPlayer(UUID id) {
super(id);
human = false;
userData = UserData.getDefaultUserDataView();
userData.setAvatarId(64);
userData.setGroupId(UserGroup.COMPUTER.getGroupId());
userData.setFlagName("computer.png");
pickedCards = new ArrayList<>();
}
@ -2551,4 +2556,21 @@ public class ComputerPlayer extends PlayerImpl implements Player {
return this.getId().equals(obj.getId());
}
@Override
public boolean isHuman() {
if (human) {
log.error("computer must be not human", new Throwable());
}
return human;
}
@Override
public void restore(Player player) {
super.restore(player);
// restore used in AI simulations
// all human players converted to computer and analyse
this.human = false;
}
}