forked from External/mage
I used Intellij IDEA to automatically refactor code to achive 3 goals. 1) get rid of anonymouse classes, and replace the with lamba to get more readeable and clean code (like in TableWaitingDialog). 2) make effectively final variables actually final to avoid inadvertent changes on it in further releases and keep objects as immutable, as possible. 3) Get rid of unused imports (most of the changes) in whole project classes.
29 lines
776 B
Java
29 lines
776 B
Java
package mage.client.util;
|
|
|
|
import java.awt.event.MouseEvent;
|
|
import java.util.UUID;
|
|
|
|
import mage.client.SessionHandler;
|
|
import mage.view.CardView;
|
|
|
|
|
|
public class DefaultActionCallback {
|
|
|
|
private static final DefaultActionCallback INSTANCE = new DefaultActionCallback();
|
|
|
|
private DefaultActionCallback() {}
|
|
|
|
public static DefaultActionCallback getInstance() {
|
|
return INSTANCE;
|
|
}
|
|
|
|
public void mouseClicked(MouseEvent e, UUID gameId, CardView card) {
|
|
if (gameId != null) {
|
|
if (card.isAbility() && card.getAbility() != null) {
|
|
SessionHandler.sendPlayerUUID(gameId, card.getAbility().getId());
|
|
} else {
|
|
SessionHandler.sendPlayerUUID(gameId, card.getId());
|
|
}
|
|
}
|
|
}
|
|
}
|