use of mage.client.game.PlayerPanelExt in project mage by magefree.
the class ArrowUtil method drawArrowsForEnchantPlayers.
public static void drawArrowsForEnchantPlayers(TransferData data, Point parentPoint) {
if (data.getGameId() != null && MageFrame.getGame(data.getGameId()) != null) {
for (PlayAreaPanel pa : MageFrame.getGamePlayers(data.getGameId()).values()) {
PlayerPanelExt playAreaPanel = pa.getPlayerPanel();
if (playAreaPanel != null && playAreaPanel.getPlayer() != null && playAreaPanel.getPlayer().hasAttachments()) {
Point me = new Point(data.getLocationOnScreen());
me.translate(-parentPoint.x, -parentPoint.y);
for (UUID attachmentId : playAreaPanel.getPlayer().getAttachments()) {
if (attachmentId.equals(data.getCard().getId())) {
Point player = pa.getLocationOnScreen();
player.translate(-parentPoint.x, -parentPoint.y);
ArrowBuilder.getBuilder().addArrow(data.getGameId(), (int) me.getX() + 35, (int) me.getY(), (int) player.getX() + 40, (int) player.getY() - 40, Color.magenta, ArrowBuilder.Type.ENCHANT_PLAYERS);
}
}
}
}
}
}
Aggregations