diff --git a/bin/controller/Cashflow.class b/bin/controller/Cashflow.class index 5362349..d6dc11f 100644 Binary files a/bin/controller/Cashflow.class and b/bin/controller/Cashflow.class differ diff --git a/src/controller/Cashflow.java b/src/controller/Cashflow.java index 3b10d14..e014536 100644 --- a/src/controller/Cashflow.java +++ b/src/controller/Cashflow.java @@ -16,13 +16,24 @@ public static void main(String[] args) /* * Just testing stuff in here for now. Main method will call the go() method when game is built */ - MarketStack ms = new MarketStack(); + BigDealStack ms = new BigDealStack(); int initialSize = ms.getSize(); for(int i=0; isize){ + return null; + } + Node n = head; + while(index-1!=0){ + n=n.next; + index--; + } + return n; + } + + public Tile elementAt(int index){ + if(index>size){ + return null; + } + Node n = head; + while(index-1!=0){ + n=n.next; + index--; + } + return n.t; + } + + //print the linked list + public void print(){ + Node temp = head; + if(size<=0){ + System.out.print("List is empty"); + }else{ + do { + System.out.print(" " + temp.t.getName()); + temp = temp.next; + } + while(temp!=head); + } + System.out.println(); + } + + //get Size + public int getSize(){ + return size; + } + + + public void addTiles(Tile... tiles) + { + for(Tile t : tiles) + { + this.addNodeAtEnd(t); + } + + } + +}