From f92608078d9d9e5faf7081ca7837a926511b6bff Mon Sep 17 00:00:00 2001 From: hm3623851 <79132538+hm3623851@users.noreply.github.com> Date: Fri, 9 Jul 2021 15:32:34 +0430 Subject: [PATCH 1/2] resolve deck problem --- src/main/java/controller/DeckController.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/controller/DeckController.java b/src/main/java/controller/DeckController.java index 62a760ed..6f67d8a8 100644 --- a/src/main/java/controller/DeckController.java +++ b/src/main/java/controller/DeckController.java @@ -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"); From dbe374f2c17773653513a1b8313449177bcba70d Mon Sep 17 00:00:00 2001 From: hm3623851 <79132538+hm3623851@users.noreply.github.com> Date: Fri, 9 Jul 2021 15:39:49 +0430 Subject: [PATCH 2/2] resolve deck problem --- src/main/java/controller/DeckController.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/main/java/controller/DeckController.java b/src/main/java/controller/DeckController.java index 6f67d8a8..b7ac0b15 100644 --- a/src/main/java/controller/DeckController.java +++ b/src/main/java/controller/DeckController.java @@ -320,9 +320,6 @@ 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)); } else { mainDeckHashMap.put(rectangle, sideDeckHashMap.get(sourceRectangle)); sideDeckHashMap.remove(sourceRectangle); @@ -340,9 +337,6 @@ public void handle(DragEvent dragEvent) { } 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)); } } sourceRectangle.setAccessibleText("null");