Closed #169: Make it possible to untap lands

This commit is contained in:
magenoxx 2013-03-29 20:35:16 +04:00
parent dd9aec6a49
commit 29b84e0d92
24 changed files with 244 additions and 207 deletions

View file

@ -570,6 +570,17 @@ public class MageServerImpl implements MageServer {
});
}
@Override
public void undo(final UUID gameId, final String sessionId) throws MageException {
execute("undo", sessionId, new Action() {
@Override
public void execute() {
UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId();
GameManager.getInstance().undo(gameId, userId);
}
});
}
@Override
public void passPriorityUntilNextYourTurn(final UUID gameId, final String sessionId) throws MageException {
execute("passPriorityUntilNextYourTurn", sessionId, new Action() {

View file

@ -255,6 +255,10 @@ public class GameController implements GameCallback {
game.concede(getPlayerId(userId));
}
public void undo(UUID userId) {
game.undo(getPlayerId(userId));
}
public void passPriorityUntilNextYourTurn(UUID userId) {
game.passPriorityUntilNextYourTurn(getPlayerId(userId));
}

View file

@ -96,6 +96,11 @@ public class GameManager {
gameControllers.get(gameId).concede(userId);
}
public void undo(UUID gameId, UUID userId) {
if (gameControllers.containsKey(gameId))
gameControllers.get(gameId).undo(userId);
}
public void passPriorityUntilNextYourTurn(UUID gameId, UUID userId) {
if (gameControllers.containsKey(gameId))
gameControllers.get(gameId).passPriorityUntilNextYourTurn(userId);