determine AI from player profile instead of from MagicDuel

master
melvinzhang 2015-04-04 21:23:12 +08:00
parent 37ab9d56a2
commit fd6ddadd09
2 changed files with 2 additions and 2 deletions

View File

@ -46,7 +46,7 @@ public class HeadlessGameController implements IGameController {
private Object[] getAIChoiceResults(final MagicEvent event) { private Object[] getAIChoiceResults(final MagicEvent event) {
//dynamically get the AI based on the player's index //dynamically get the AI based on the player's index
final MagicPlayer player = event.getPlayer(); final MagicPlayer player = event.getPlayer();
final MagicAI ai = game.getDuel().getAIs()[player.getIndex()]; final MagicAI ai = player.getPlayerDefinition().getPlayerProfile().getAiType().getAI();
return ai.findNextEventChoiceResults(game, player); return ai.findNextEventChoiceResults(game, player);
} }
} }

View File

@ -587,7 +587,7 @@ public class SwingGameController implements IUIGameController, ILogBookListener
//dynamically get the AI based on the player's index //dynamically get the AI based on the player's index
final MagicPlayer player = event.getPlayer(); final MagicPlayer player = event.getPlayer();
final MagicAI ai = game.getDuel().getAIs()[player.getIndex()]; final MagicAI ai = player.getPlayerDefinition().getPlayerProfile().getAiType().getAI();
return ai.findNextEventChoiceResults(game, player); return ai.findNextEventChoiceResults(game, player);
} }