removed the Session out of local scope and introduced a static SessionHandler that acts as interface to remote.Session

This commit is contained in:
ingmargoudt 2016-09-15 20:52:41 +02:00
parent 360823ec2e
commit 3019991473
28 changed files with 545 additions and 271 deletions

View file

@ -3,6 +3,7 @@ package mage.client.util;
import java.awt.event.MouseEvent;
import java.util.UUID;
import mage.client.SessionHandler;
import mage.remote.Session;
import mage.view.CardView;
@ -17,12 +18,12 @@ public class DefaultActionCallback {
return INSTANCE;
}
public void mouseClicked(MouseEvent e, UUID gameId, Session session, CardView card) {
public void mouseClicked(MouseEvent e, UUID gameId, CardView card) {
if (gameId != null) {
if (card.isAbility() && card.getAbility() != null) {
session.sendPlayerUUID(gameId, card.getAbility().getId());
SessionHandler.sendPlayerUUID(gameId, card.getAbility().getId());
} else {
session.sendPlayerUUID(gameId, card.getId());
SessionHandler.sendPlayerUUID(gameId, card.getId());
}
}
}