mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
* Imporoved release of draft object during draft tournament.
This commit is contained in:
parent
4e56e584b6
commit
adbd1bca94
4 changed files with 19 additions and 3 deletions
|
|
@ -823,10 +823,13 @@ public class TableController {
|
|||
}
|
||||
|
||||
public void endDraft(Draft draft) {
|
||||
for (DraftPlayer player: draft.getPlayers()) {
|
||||
player.prepareDeck();
|
||||
tournament.getPlayer(player.getPlayer().getId()).setDeck(player.getDeck());
|
||||
if (!draft.isAbort()) {
|
||||
for (DraftPlayer player: draft.getPlayers()) {
|
||||
player.prepareDeck();
|
||||
tournament.getPlayer(player.getPlayer().getId()).setDeck(player.getDeck());
|
||||
}
|
||||
}
|
||||
tournament.clearDraft(); // free the draft resources after draft step has ended
|
||||
tournament.nextStep();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -198,6 +198,7 @@ public class DraftController {
|
|||
draftSession.removeDraft();
|
||||
}
|
||||
TableManager.getInstance().endDraft(tableId, draft);
|
||||
DraftManager.getInstance().removeDraft(draft.getId());
|
||||
}
|
||||
|
||||
public void kill(UUID userId) {
|
||||
|
|
@ -259,5 +260,10 @@ public class DraftController {
|
|||
|
||||
public void abortDraft() {
|
||||
draft.setAbort(true);
|
||||
try {
|
||||
endDraft();
|
||||
} catch(MageException ex) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue