Added context menu to switch between manual and automatic usage of the mana in mana pool. Manual usage is done by clicking on the mana symbol in the player panel. Still some fine tuning to do.

This commit is contained in:
LevelX2 2014-05-24 02:56:35 +02:00
parent eeead4a8b4
commit 71fb7bf25b
26 changed files with 415 additions and 100 deletions

View file

@ -36,6 +36,7 @@ import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
import mage.cards.decks.Deck;
import mage.constants.ManaType;
import mage.game.Table;
import mage.interfaces.callback.ClientCallback;
import mage.players.net.UserData;
@ -137,7 +138,7 @@ public class User {
public String getDisconnectDuration() {
long secondsDisconnected = SystemUtil.getDateDiff(lastActivity, new Date(), TimeUnit.SECONDS);
long secondsLeft = 0;
long secondsLeft;
String sign = "";
if (secondsDisconnected > (3 * 60)) {
sign="-";
@ -222,6 +223,11 @@ public class User {
GameManager.getInstance().sendPlayerString(gameId, userId, data);
}
public void sendPlayerManaType(final UUID gameId, final ManaType data) {
lastActivity = new Date();
GameManager.getInstance().sendPlayerManaType(gameId, userId, data);
}
public void sendPlayerBoolean(final UUID gameId, final Boolean data) {
lastActivity = new Date();
GameManager.getInstance().sendPlayerBoolean(gameId, userId, data);