Skip to content

Commit

Permalink
Merge pull request #379 from Advanced-Programming-2021/torrent
Browse files Browse the repository at this point in the history
Torrent
  • Loading branch information
hm3623851 authored Jul 9, 2021
2 parents 72bb3be + dbe374f commit f9df1b4
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/main/java/controller/DeckController.java
Original file line number Diff line number Diff line change
Expand Up @@ -320,29 +320,23 @@ public void handle(DragEvent dragEvent) {
if (bool) {
mainDeckHashMap.put(rectangle, mainDeckHashMap.get(sourceRectangle));
mainDeckHashMap.remove(sourceRectangle);
deck.addCard(mainDeckHashMap.get(rectangle).getCardName(), false,
User.getUserByUsername(username));
deck.deleteCard(mainDeckHashMap.get(rectangle).getCardName(), false);
} else {
mainDeckHashMap.put(rectangle, sideDeckHashMap.get(sourceRectangle));
sideDeckHashMap.remove(sourceRectangle);
deck.deleteCard(mainDeckHashMap.get(rectangle).getCardName(), true);
deck.addCard(mainDeckHashMap.get(rectangle).getCardName(), false,
User.getUserByUsername(username));
deck.deleteCard(mainDeckHashMap.get(rectangle).getCardName(), true);
}
} else {
if (bool) {
sideDeckHashMap.put(rectangle, mainDeckHashMap.get(sourceRectangle));
mainDeckHashMap.remove(sourceRectangle);
deck.deleteCard(sideDeckHashMap.get(rectangle).getCardName(), false);
deck.addCard(sideDeckHashMap.get(rectangle).getCardName(), true,
User.getUserByUsername(username));
deck.deleteCard(sideDeckHashMap.get(rectangle).getCardName(), false);
} else {
sideDeckHashMap.put(rectangle, sideDeckHashMap.get(sourceRectangle));
sideDeckHashMap.remove(sourceRectangle);
deck.addCard(sideDeckHashMap.get(rectangle).getCardName(), true,
User.getUserByUsername(username));
deck.deleteCard(sideDeckHashMap.get(rectangle).getCardName(), true);
}
}
sourceRectangle.setAccessibleText("null");
Expand Down

0 comments on commit f9df1b4

Please sign in to comment.