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