|
|
@ -13,9 +13,15 @@ public abstract class BaseStack extends JPanel { |
|
|
|
private ArrayList<Card> stack = new ArrayList<Card>(); |
|
|
|
private final int OFFSET_VALUE = 20; |
|
|
|
int offset; |
|
|
|
int addOffset; |
|
|
|
|
|
|
|
public BaseStack() { |
|
|
|
public BaseStack(boolean _offset) { |
|
|
|
// TODO Auto-generated constructor stub |
|
|
|
if(_offset) { |
|
|
|
addOffset = OFFSET_VALUE; |
|
|
|
}else { |
|
|
|
addOffset = 0; |
|
|
|
} |
|
|
|
offset = 0; |
|
|
|
} |
|
|
|
|
|
|
@ -43,13 +49,13 @@ public abstract class BaseStack extends JPanel { |
|
|
|
_card.setLocation(0, offset); |
|
|
|
stack.add(_card); |
|
|
|
RenderStackNew(); |
|
|
|
offset += OFFSET_VALUE; |
|
|
|
offset += addOffset; |
|
|
|
} |
|
|
|
|
|
|
|
public Card removeLastCard() { |
|
|
|
if (stack.size() != 0) { |
|
|
|
Card LastCard = stack.remove(stack.size() - 1); |
|
|
|
offset -= OFFSET_VALUE; |
|
|
|
offset -= addOffset; |
|
|
|
RenderStackNew(); |
|
|
|
return LastCard; |
|
|
|
} |
|
|
|