Skip to content

Commit

Permalink
resolve deck problem
Browse files Browse the repository at this point in the history
  • Loading branch information
hm3623851 committed Jul 9, 2021
1 parent 72bb3be commit f926080
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/controller/DeckController.java
Original file line number Diff line number Diff line change
Expand Up @@ -320,29 +320,29 @@ public void handle(DragEvent dragEvent) {
if (bool) {
mainDeckHashMap.put(rectangle, mainDeckHashMap.get(sourceRectangle));
mainDeckHashMap.remove(sourceRectangle);
deck.deleteCard(mainDeckHashMap.get(rectangle).getCardName(), false);
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.deleteCard(sideDeckHashMap.get(rectangle).getCardName(), true);
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 f926080

Please sign in to comment.