Skip to content

Commit

Permalink
More doodad changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe authored and Joe committed Mar 3, 2017
1 parent 53e1fc0 commit 6df1649
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 19 deletions.
Binary file modified bin/controller/Cashflow.class
Binary file not shown.
4 changes: 2 additions & 2 deletions src/controller/Cashflow.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ public static void main(String[] args)
{
DoodadStack ds = new DoodadStack();

int initialSize = ds.getStack().getSize();
int initialSize = ds.getSize();
for(int i=0; i<initialSize; i++)
{
int num = i+1;
System.out.println(num + ": " + ds.getStack().pop().getTitle());
System.out.println(num + ": " + ds.pop().getTitle());
}

}
Expand Down
26 changes: 10 additions & 16 deletions src/model/DoodadStack.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@

import java.util.*;

public class DoodadStack
public class DoodadStack extends CardStack
{
private CardStack _doodadCardStack;

private static DoodadCard D01 = new DoodadCard("New Tennis Racket", 200);
private static DoodadCard D02 = new DoodadCard("Food Processor",200);
private static DoodadCard D03 = new DoodadCard("Birthday Party for You Child", 500); //if you have a child
private static DoodadCard D04 = new DoodadCard("Next-Gen Game Console", 600);
private static DoodadCard D05 = new DoodadCard("First DoodadCard for Child (Take out a loan if you must)", 5000); //if you have a child
private static DoodadCard D05 = new DoodadCard("First Car for Child (Take out a loan if you must)", 5000); //if you have a child
private static DoodadCard D06 = new DoodadCard("Jet Ski (Take out a loan if you must)", 3000);
private static DoodadCard D07 = new DoodadCard("New Tailored Suit", 1000);
private static DoodadCard D08 = new DoodadCard("New Rims for Your DoodadCard (Take outa loan if you must)", 2000);
Expand Down Expand Up @@ -51,17 +49,17 @@ public class DoodadStack
private static DoodadCard D41 = new DoodadCard("Remodel Kitchen (Take out a loan if you must)", 7500);
private static DoodadCard D42 = new DoodadCard("Season Tickets", 1500);


// Constructor just calls makes this stack a randomized stack with Doodad cards
public DoodadStack()
{
_doodadCardStack = randomizeStack();
randomizeStack();
}



private CardStack randomizeStack()
// Randomizes the stack with the member variable cards
private void randomizeStack()
{
CardStack cardStack = new CardStack();
//CardStack cardStack = new CardStack();
ArrayList<DoodadCard> cardList = new ArrayList<DoodadCard>();
Random r = new Random();
DoodadCard[] cardArray = {D01, D02, D03, D04, D05, D06, D07, D08, D09, D10,
Expand All @@ -75,19 +73,15 @@ private CardStack randomizeStack()
cardList.add(c);
}

// Pushes a card at a random index in the card list
int initialLength = cardList.size();
for(int i=0; i < initialLength; i++)
{
cardStack.push(cardList.remove(r.nextInt(cardList.size())));
this.push(cardList.remove(r.nextInt(cardList.size())));
}
return cardStack;

}

public CardStack getStack()
{
return _doodadCardStack;
}




Expand Down
10 changes: 10 additions & 0 deletions src/model/MarketCard.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package model;

public class MarketCard extends Card
{
public MarketCard(String title, int value) {
super(title, value);
// TODO Auto-generated constructor stub
}

}
2 changes: 1 addition & 1 deletion src/model/Market_Cards.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* hi im very forgetful so my code is usually full of comments when its not finished sorry
*
*/
public class Market_Cards extends Card {
public class MarketCardStack extends Card {

public Market_Cards(String title, String type, Boolean effect, int value, int value2, int value3, int value4) {
super(title, type, effect, value, value2, value3, value4);
Expand Down

0 comments on commit 6df1649

Please sign in to comment.