// Laura Beckwith // // cs589 -- Winter 2001 import java.util.*; public class Pile { private Vector chips= new Vector(); private int nTotValue= 0; private int nTot=0; public int getnTotValue(){ return nTotValue; } public int getTotNum(){ return chips.size(); } public void addChip(PokerChip pc){ nTot++; nTotValue += pc.getChipValue(); chips.addElement(pc); } public PokerChip removeTop(){ PokerChip pc = new PokerChip(); pc = (PokerChip)chips.elementAt(nTot-1); chips.removeElementAt(nTot-1); nTotValue = nTotValue - pc.getChipValue(); nTot--; return pc; } public PokerChip returnChip(int x){ return (PokerChip)chips.elementAt(x); } }