mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
Closed #169: Make it possible to untap lands
This commit is contained in:
parent
dd9aec6a49
commit
29b84e0d92
24 changed files with 244 additions and 207 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue