|
@ -99,15 +99,14 @@ public class MyMouseListener implements MouseInputListener { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
//Clear Save |
|
|
|
|
|
|
|
|
// Clear Save |
|
|
clearSaveStack(selectedStack); |
|
|
clearSaveStack(selectedStack); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
// GeberStack |
|
|
// GeberStack |
|
|
else if (com.getParent() instanceof GeberStack |
|
|
|
|
|
|| com instanceof GeberStack) { |
|
|
|
|
|
|
|
|
else if (com.getParent() instanceof GeberStack || com instanceof GeberStack) { |
|
|
System.out.println("GeberStack"); |
|
|
System.out.println("GeberStack"); |
|
|
if (com instanceof GeberStack) { |
|
|
if (com instanceof GeberStack) { |
|
|
tempStack = (GeberStack) com; |
|
|
tempStack = (GeberStack) com; |
|
@ -122,7 +121,28 @@ public class MyMouseListener implements MouseInputListener { |
|
|
((GeberStack) this.tempStack).moveToWaste(); |
|
|
((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) { |
|
|
private void clearSaveStack(BaseStack _ziel) { |
|
|
// Alles wieder auf den Ursprünglichen Stack packen |
|
|
// Alles wieder auf den Ursprünglichen Stack packen |
|
|
while (!saveStack.stackIsEmpty()) { |
|
|
while (!saveStack.stackIsEmpty()) { |
|
|