|
|
@ -99,15 +99,14 @@ public class MyMouseListener implements MouseInputListener { |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
//Clear Save |
|
|
|
// Clear Save |
|
|
|
clearSaveStack(selectedStack); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
// GeberStack |
|
|
|
else if (com.getParent() instanceof GeberStack |
|
|
|
|| com instanceof GeberStack) { |
|
|
|
else if (com.getParent() instanceof GeberStack || com instanceof GeberStack) { |
|
|
|
System.out.println("GeberStack"); |
|
|
|
if (com instanceof GeberStack) { |
|
|
|
tempStack = (GeberStack) com; |
|
|
@ -122,7 +121,28 @@ public class MyMouseListener implements MouseInputListener { |
|
|
|
((GeberStack) this.tempStack).moveToWaste(); |
|
|
|
} |
|
|
|
} |
|
|
|
// WasteStack |
|
|
|
else if (com.getParent() instanceof WasteStack || com instanceof WasteStack) { |
|
|
|
System.out.println("WasteStack"); |
|
|
|
if (com instanceof WasteStack) { |
|
|
|
tempStack = (WasteStack) com; |
|
|
|
} else { |
|
|
|
tempStack = (WasteStack) com.getParent(); |
|
|
|
} |
|
|
|
|
|
|
|
if (saveStack.stackIsEmpty()) { |
|
|
|
// Move Top Card from AblageStack in Save |
|
|
|
if (tempStack.stackIsEmpty() == false) { |
|
|
|
saveStack.addCard(tempStack.removeLastCard()); |
|
|
|
selectedStack = tempStack; |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
clearSaveStack(selectedStack); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private void clearSaveStack(BaseStack _ziel) { |
|
|
|
// Alles wieder auf den Ursprünglichen Stack packen |
|
|
|
while (!saveStack.stackIsEmpty()) { |
|
|
|