Skip to content

Commit

Permalink
Doodads done. Working on the others now
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe authored and Joe committed Mar 3, 2017
1 parent 99d866e commit dafba63
Show file tree
Hide file tree
Showing 9 changed files with 167 additions and 84 deletions.
Binary file modified bin/controller/Cashflow.class
Binary file not shown.
12 changes: 10 additions & 2 deletions src/controller/Cashflow.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
package controller;

import view.*;
import model.*;

public class Cashflow
{
public static void main(String[] args)
{
new MainWindow();
System.out.println("Hello");
DoodadStack ds = new DoodadStack();

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

}
}
34 changes: 10 additions & 24 deletions src/model/Card.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,56 +9,41 @@
*/

public class Card

{

private String _title;

private String _type; // you dont have to use this but i added it because theres so many different types of market cards i need something to keep track of which is which
//private String _type; // you dont have to use this but i added it because theres so many different types of market cards i need something to keep track of which is which

private Boolean _effect; //True if it effects all players
//private Boolean _effect; //True if it effects all players

private int _value; // Any integer value that can be attached to the card. If card needs no value, put 0. Value of cost for deal cards.

private int _value2; //value of Down Payment
//private int _value2; //value of Down Payment

private int _value3; //value of Mortgage
//private int _value3; //value of Mortgage

private int _value4; //value of Cash Flow
//private int _value4; //value of Cash Flow



public Card (String title, String type, Boolean effect, int value, int value2, int value3, int value4){
public Card(String title, int value){

_title = title;

_type = type;

_effect = effect;

_value = value;

_value2 = value2;

_value3 = value3;

_value4 = value4;

}

public String getTitle()

{
return _title;
}

public String getType()
{
return _type;
}

public int getValue(){
return _value;
}

/**
public int getValue2(){
return _value2;
}
Expand All @@ -68,6 +53,7 @@ public int getValue3(){
public int getValue4(){
return _value4;
}
*/



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

import java.util.Stack;

/**
* Made this class just to add functionality to a general stack to keep track of its size
* @author Joe
*
*/
public class CardStack extends Stack<Card>
{
private static final long serialVersionUID = 1L;
private int _size;

public CardStack()
{
super();
_size = 0;
}

@Override
public Card push(Card c)
{
_size++;
return super.push(c);
}

@Override
public Card pop()
{
_size--;
return super.pop();
}

public int getSize()
{
return _size;
}
}
1 change: 0 additions & 1 deletion src/model/Die.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package model;
import java.util.Random;


public class Die {
/*
* Die will probably have to go in each individual turn, so that it can pull charity status
Expand Down
10 changes: 10 additions & 0 deletions src/model/DoodadCard.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package model;

public class DoodadCard extends Card
{
public DoodadCard(String title, int value)
{
super(title, value);
}

}
94 changes: 94 additions & 0 deletions src/model/DoodadStack.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
package model;

import java.util.*;

public class DoodadStack
{
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 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);
private static DoodadCard D09 = new DoodadCard("New Car Stereo", 700);
private static DoodadCard D10 = new DoodadCard("Go to Casino", 800);
private static DoodadCard D11 = new DoodadCard("New Easy Chair", 500);
private static DoodadCard D12 = new DoodadCard("Cappuccino Machine", 300);
private static DoodadCard D13 = new DoodadCard("Pay for Lunch with Friends", 200);
private static DoodadCard D14 = new DoodadCard("New Computuer (Take out a loan if you must)", 1800);
private static DoodadCard D15 = new DoodadCard("Golf Club Membership (Take out a loan if you must)", 2000);
private static DoodadCard D16 = new DoodadCard("Child Needs Braces (Take out a loan if you must)", 4000);
//if you have a child
private static DoodadCard D17 = new DoodadCard("Concert Tickets", 200);
private static DoodadCard D18 = new DoodadCard("New Watch", 200);
private static DoodadCard D19 = new DoodadCard("New Tires", 600);
private static DoodadCard D20 = new DoodadCard("Replace Car Air Conditioner", 700);
private static DoodadCard D21 = new DoodadCard("Get Newest Phone", 300);
private static DoodadCard D22 = new DoodadCard("New Sunglasses", 200);
private static DoodadCard D23 = new DoodadCard("New Gym Clothes", 300);
private static DoodadCard D24 = new DoodadCard("New Clothes", 1000);
private static DoodadCard D25 = new DoodadCard("Private Tutoring for Your Child", 500);
//if you have a child
private static DoodadCard D26 = new DoodadCard("Big Screen TV (Take out a loan if you must)", 2500);
private static DoodadCard D27 = new DoodadCard("Date Night: Dinner, Concert & Dessert", 500);
private static DoodadCard D28 = new DoodadCard("Take a Trip to Wine Country", 1000);
private static DoodadCard D29 = new DoodadCard("Buy Local Artist's Painting", 800);
private static DoodadCard D30 = new DoodadCard("High School Reunion", 500);
private static DoodadCard D31 = new DoodadCard("Build a Home Gym (Take out a loan if you must)", 3000);
private static DoodadCard D32 = new DoodadCard("New Golf Clubs", 800);
private static DoodadCard D33 = new DoodadCard("Costume Jewlry", 400);
private static DoodadCard D34 = new DoodadCard("Fishing Boat (Take out a loan if you must)", 5000);
private static DoodadCard D35 = new DoodadCard("New Bowling Ball", 100);
private static DoodadCard D36 = new DoodadCard("Repaint Your House", 600);
private static DoodadCard D37 = new DoodadCard("New Sound System", 1500);
private static DoodadCard D38 = new DoodadCard("Visit the Dentist (Maybe get a shiny gold tooth!)", 700);
private static DoodadCard D39 = new DoodadCard("Help Pay for Child's Wedding", 2000);
private static DoodadCard D40 = new DoodadCard("Family Vacation (Take out a loan if you must)", 2500);
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);


public DoodadStack()
{
_doodadCardStack = randomizeStack();
}



private CardStack randomizeStack()
{
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,
D11, D12, D13, D14, D15, D16, D17, D18, D19, D20,
D21, D22, D23, D24, D25, D26, D27, D28, D29, D30,
D31, D32, D33, D34, D35, D36, D37, D38, D39, D40, D41, D42};

// Add all array contents to list
for(DoodadCard c : cardArray)
{
cardList.add(c);
}

int initialLength = cardList.size();
for(int i=0; i < initialLength; i++)
{
cardStack.push(cardList.remove(r.nextInt(cardList.size())));
}
return cardStack;

}

public CardStack getStack()
{
return _doodadCardStack;
}



}
55 changes: 0 additions & 55 deletions src/model/Doodads.java

This file was deleted.

6 changes: 4 additions & 2 deletions src/model/Professions.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

public class Professions
{


Profession Nurse = new Profession("Nurse", 3100, 600, 400, 100, 100, 200, 600, 0, 0, 200, 500, 47000, 6000, 5000, 4000);

Profession Teacher = new Profession("Teacher", 3300, 500, 500, 100, 100, 200, 700, 0, 0,
Expand Down Expand Up @@ -47,6 +45,10 @@ public class Professions

public Profession playerProf;

public Professions() {}



public Profession getProfession()
{
Random rand = new Random();
Expand Down

0 comments on commit dafba63

Please sign in to comment.