From ec18817c7fac028037ad81e7fddc025755fbc06a Mon Sep 17 00:00:00 2001 From: Jacklyn J Videira Date: Fri, 24 Mar 2017 14:39:00 -0400 Subject: [PATCH 1/3] Rename CharityTile to CharityTile.java --- src/model/{CharityTile => CharityTile.java} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/model/{CharityTile => CharityTile.java} (100%) diff --git a/src/model/CharityTile b/src/model/CharityTile.java similarity index 100% rename from src/model/CharityTile rename to src/model/CharityTile.java From 2631b9b7fa4e92060f105e2a9a74929afed36c83 Mon Sep 17 00:00:00 2001 From: Jacklyn J Videira Date: Fri, 24 Mar 2017 14:45:18 -0400 Subject: [PATCH 2/3] whoops --- src/model/{CharityTile.java => CharityTile} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/model/{CharityTile.java => CharityTile} (100%) diff --git a/src/model/CharityTile.java b/src/model/CharityTile similarity index 100% rename from src/model/CharityTile.java rename to src/model/CharityTile From 41b18a4cf752297045e4ab61b2f70154e2c3b76e Mon Sep 17 00:00:00 2001 From: jackie Date: Fri, 24 Mar 2017 15:51:26 -0400 Subject: [PATCH 3/3] just some stuff & things --- src/model/BigDealStack.java | 11 ++- src/model/DoodadStack.java | 8 ++ src/model/FinancialStatement.java | 2 +- src/model/MarketCard.java | 11 +-- src/model/MarketStack.java | 129 ++++++++++++++---------------- src/model/SmallDealStack.java | 18 ++++- 6 files changed, 98 insertions(+), 81 deletions(-) diff --git a/src/model/BigDealStack.java b/src/model/BigDealStack.java index e268cc2..6248441 100644 --- a/src/model/BigDealStack.java +++ b/src/model/BigDealStack.java @@ -1,5 +1,9 @@ package model; +import java.util.Arrays; +import java.util.List; +import java.util.Stack; + public class BigDealStack extends CardStack { private static DealCard BD1= new DealCard("Limited Partner Wanted", @@ -110,7 +114,7 @@ public class BigDealStack extends CardStack private static DealCard BD36 = new DealCard("House for Sale - 3Br/2Ba", "Skilled Tradesman kept this 3/2 house in excellent condition, so it commands top-dollar rent in older neighborhood", 325000, 18000, 307000, 900); - + private Stack _bigDealStack; public BigDealStack() { DealCard[] bdCardArray = {BD1, BD2, BD3, BD4, BD5, BD6, BD7, BD8, BD9, BD10, @@ -118,6 +122,11 @@ public BigDealStack() BD21, BD22, BD23, BD24, BD25, BD26, BD27, BD28, BD29, BD30, BD31, BD32, BD33, BD34, BD35, BD36}; super.randomizeCards(bdCardArray); + List list = Arrays.asList(bdCardArray); + Stack BDCardStack = new Stack(); + BDCardStack.addAll(list); + + _bigDealStack = BDCardStack; } diff --git a/src/model/DoodadStack.java b/src/model/DoodadStack.java index cd36519..a30512e 100644 --- a/src/model/DoodadStack.java +++ b/src/model/DoodadStack.java @@ -50,6 +50,8 @@ public class DoodadStack extends CardStack private static DoodadCard D42 = new DoodadCard("Season Tickets", 1500); // Constructor just calls makes this stack a randomized stack with Doodad cards + private Stack _doodadStack; + public DoodadStack() { DoodadCard[] cardArray = {D01, D02, D03, D04, D05, D06, D07, D08, D09, D10, @@ -58,6 +60,12 @@ public DoodadStack() D31, D32, D33, D34, D35, D36, D37, D38, D39, D40, D41, D42}; super.randomizeCards(cardArray); + List list = Arrays.asList(cardArray); + Stack DoodadCardStack = new Stack(); + DoodadCardStack.addAll(list); + + _doodadStack = DoodadCardStack; + } diff --git a/src/model/FinancialStatement.java b/src/model/FinancialStatement.java index 49e8dcd..27e1816 100644 --- a/src/model/FinancialStatement.java +++ b/src/model/FinancialStatement.java @@ -7,7 +7,7 @@ public class FinancialStatement private double[] realEstate; private String career; private double expenses; - private double assets; + public static double assets; //sorry i had to make this change to use w/ cards if i messed something up just change it im sorry!! private double liabilities; private double income; diff --git a/src/model/MarketCard.java b/src/model/MarketCard.java index c156b8b..5fd542c 100644 --- a/src/model/MarketCard.java +++ b/src/model/MarketCard.java @@ -4,16 +4,14 @@ public class MarketCard extends Card { private String _description; private String _type; - private boolean _affectAll; private int _value; private String _addit; - public MarketCard(String title, String description, String type, boolean affectAll, int value, String addit) + public MarketCard(String title, String description, String type, int value, String addit) { super(title); _description = description; _type = type; - _affectAll = affectAll; _value = value; _addit = addit; //additional info } @@ -28,10 +26,6 @@ public String getType() return _type; } - public boolean doesAffectAll() - { - return _affectAll; - } public int getValue() { @@ -41,6 +35,9 @@ public String getAddit() { return _addit; } + public void display(){ + //display cards in a pretty gui + } } diff --git a/src/model/MarketStack.java b/src/model/MarketStack.java index 3156675..6c3a252 100644 --- a/src/model/MarketStack.java +++ b/src/model/MarketStack.java @@ -1,18 +1,19 @@ package model; -/* - * hi im very forgetful so my code is usually full of comments when its not finished sorry - * - */ +import java.util.Arrays; +import java.util.Stack; +import java.util.List; + public class MarketStack extends CardStack { //Not sure how we're working in the descriptions as it's a more graphical concept but for now I'm going to type them out +/* private static MarketCard Profit1 = new MarketCard("Small Business Boom!", "The downtown economy has exploded! EVERYONE is affected! ALL businesses with a cash flow of $1000 or less have their cash flow increased by $250", "profit", true, 250, ""); private static MarketCard Profit2 = new MarketCard("New Management System", "A new management system creates new efficiencies and lowers costs. Only the person who drew this MarketCard is affected.", "profit", false, 400, ""); - + */ //gold MarketCard - value is $ per coin // private static MarketCard Gold1 = new MarketCard("Price of Gold Soars", // "The Central Bank is printing money in an attempt to boost the economy causing massive inflation. The price of gold skyrockets. Buyer offers $2000 for each gold coin. Everyone may sell any number of coins at this price.", @@ -30,19 +31,19 @@ public class MarketStack extends CardStack //expense MarketCard - quite obviously the value is how much this expense costs private static MarketCard Expense1 = new MarketCard("Sewer Line Breaks", "Water is everywhere at your property! Pay $1000 for a new sewer line (one time). Take out a bank loan if necessary to cover these expenses. MarketCard applies only to the person who drew it. If you own NO real estate, ignore this MarketCard.", - "expense", false, 1000, ""); + "expense", 1000, ""); private static MarketCard Expense2 = new MarketCard("Sewer Line Breaks", "Water is everywhere at your property! Pay $2000 for a new sewer line (one time). Take out a bank loan if necessary to cover these expenses. MarketCard applies only to the person who drew it. If you own NO real estate, ignore this MarketCard.", - "expense", false, 2000, ""); + "expense", 2000, ""); private static MarketCard Expense3 = new MarketCard("Tenant Damages Your Property", "Tenant refuses to pay rent. After the tenant has been evicted, you discover significant damage to your property. Insurance covers most repairs, but you still must pay $500(one time). Take out a bank loan if necessary to cover these expenses. MarketCard applies only to the person who drew it. If you own NO real estate, ignore this MarketCard.", - "expense", false, 500, ""); + "expense", 500, ""); private static MarketCard Expense4 = new MarketCard("Tenant Damages Your Property", "Tenant refuses to pay rent. After the tenant has been evicted, you discover significant damage to your property. Insurance covers most repairs, but you still must pay $500(one time). Take out a bank loan if necessary to cover these expenses. MarketCard applies only to the person who drew it. If you own NO real estate, ignore this MarketCard.", - "expense", false, 500, ""); + "expense", 500, ""); private static MarketCard Expense5 = new MarketCard("Tenant Damages Your Property", "Tenant refuses to pay rent. After the tenant has been evicted, you discover significant damage to your property. Insurance covers most repairs, but you still must pay $1000(one time). Take out a bank loan if necessary to cover these expenses. MarketCard applies only to the person who drew it. If you own NO real estate, ignore this MarketCard.", - "expense", false, 1000 ,""); + "expense", 1000 ,""); //stock MarketCard - no value necessary //private static MarketCard Stock1 = new MarketCard("Stock - MYT4U Electronics Co.", @@ -61,90 +62,92 @@ public class MarketStack extends CardStack //repercent - how much percentage selling your property would yield you (aka if it's current cost + 10%, you'd yield 110% of the original cost in the sale minus what you owe private static MarketCard REPercent1 = new MarketCard("House Buyer - 3BR/2BA", "Buyer searching for 3Br/2Ba house. Offers your original cost plus 10%. Everyone may sell any number of properties at this price. If you sell, pay off the related mortgage and give up the cash flow on this property.", - "repercent",true,110,"3Br2Ba"); + "repercent",110,"3Br2Ba"); private static MarketCard REPercent2 = new MarketCard("House Buyer - 2BR/1BA", "Buyer looking to aquire 2Br/1Ba rentals. Offers your original cost plus 10%. Everyone may sell any number of properties at this price. If you sell, pay off the related mortgage and give up the cash flow on this property.", - "repercent",true,110,"2Br1Ba"); + "repercent",110,"2Br1Ba"); private static MarketCard REPercent3 = new MarketCard("House Buyer - 3BR/2BA", "Buyer searching for 3Br/2Ba house. Offers your original cost plus 20%. Everyone may sell any number of properties at this price. If you sell, pay off the related mortgage and give up the cash flow on this property.", - "repercent",true,120,"3Br2Ba"); + "repercent",120,"3Br2Ba"); private static MarketCard REPercent4 = new MarketCard("House Buyer - 2BR/1BA", "Buyer looking to aquire 2Br/1Ba rentals. Offers your original cost plus 20%. Everyone may sell any number of properties at this price. If you sell, pay off the related mortgage and give up the cash flow on this property.", - "repercent",true,120,"2Br1Ba"); + "repercent",120,"2Br1Ba"); private static MarketCard REPercent5 = new MarketCard("House Buyer - 3BR/2BA", "Buyer searching for 3Br/2Ba house. Offers your original cost plus 15%. Everyone may sell any number of properties at this price. If you sell, pay off the related mortgage and give up the cash flow on this property.", - "repercent",true,115,"3Br2Ba"); + "repercent",115,"3Br2Ba"); private static MarketCard REPercent6 = new MarketCard("Plex Buyer", "Buyer looking for all Apartment and Plexes in any combination of units. Offers your original cost plus 10%. Everyone may sell any number of properties at this price. If you sell, pay off the related mortgage and give up the cash flow on this property.", - "repercent",true,110,"plex"); + "repercent",110,"plex"); private static MarketCard REPercent7 = new MarketCard("Plex Buyer", "Buyer looking for all Apartment and Plexes in any combination of units. Offers your original cost plus 5%. Everyone may sell any number of properties at this price. If you sell, pay off the related mortgage and give up the cash flow on this property.", - "repercent",true,105,"plex"); + "repercent",105,"plex"); private static MarketCard REPercent8 = new MarketCard("Plex Buyer", "Buyer looking for all Apartment and Plexes in any combination of units. Offers your original cost plus 15%. Everyone may sell any number of properties at this price. If you sell, pay off the related mortgage and give up the cash flow on this property.", - "repercent",true,115,"plex"); + "repercent",115,"plex"); private static MarketCard REPercent9 = new MarketCard("Plex Buyer", "Buyer looking for all Apartment and Plexes in any combination of units. Offers your original cost plus 20%. Everyone may sell any number of properties at this price. If you sell, pay off the related mortgage and give up the cash flow on this property.", - "repercent",true,120,"plex"); + "repercent",120,"plex"); //refixed - value is the amount of money you get for selling property private static MarketCard REFixed1 = new MarketCard("House Buyer - 3BR/2BA", "Buyer searching for 3Br/2Ba house. Offers your original cost plus $15,000. Everyone may sell any number of properties at this price. If you sell, pay off the related mortgage and give up the cash flow on this property.", - "refixed",true,15000,"3Br2Ba"); + "refixed",15000,"3Br2Ba"); private static MarketCard REFixed2 = new MarketCard("House Buyer - 3BR/2BA", "Buyer searching for 3Br/2Ba house. Offers your original cost plus $10,000. Everyone may sell any number of properties at this price. If you sell, pay off the related mortgage and give up the cash flow on this property.", - "refixed",true,10000,"3Br2Ba"); + "refixed",10000,"3Br2Ba"); private static MarketCard REFixed3 = new MarketCard("House Buyer - 3BR/2BA", "Buyer searching for 3Br/2Ba house. Offers your original cost plus $20,000. Everyone may sell any number of properties at this price. If you sell, pay off the related mortgage and give up the cash flow on this property.", - "refixed",true,20000,"3Br2Ba"); + "refixed",20000,"3Br2Ba"); private static MarketCard REFixed4 = new MarketCard("House Buyer - 3BR/2BA", "Buyer searching for 3Br/2Ba house. Offers your original cost plus $5,000. Everyone may sell any number of properties at this price. If you sell, pay off the related mortgage and give up the cash flow on this property.", - "refixed",true,5000,"3Br2Ba"); + "refixed",5000,"3Br2Ba"); private static MarketCard REFixed5 = new MarketCard("Plex Buyer", "Buyer looking for all Apartment and Plexes in any combination of units. Offers your original cost plus $1,000. Everyone may sell any number of properties at this price. If you sell, pay off the related mortgage and give up the cash flow on this property.", - "refixed",true,1000,"plex"); + "refixed",1000,"plex"); private static MarketCard REFixed6 = new MarketCard("Plex Buyer", "Buyer looking for all Apartment and Plexes in any combination of units. Offers your original cost plus $30,000. Everyone may sell any number of properties at this price. If you sell, pay off the related mortgage and give up the cash flow on this property.", - "refixed",true,30000,"plex"); + "refixed",30000,"plex"); private static MarketCard REFixed7 = new MarketCard("Plex Buyer", "Buyer looking for all Apartment and Plexes in any combination of units. Offers your original cost plus $15,000. Everyone may sell any number of properties at this price. If you sell, pay off the related mortgage and give up the cash flow on this property.", - "refixed",true,15000,"plex"); + "refixed",15000,"plex"); private static MarketCard REFixed8 = new MarketCard("Plex Buyer", "Buyer looking for all Apartment and Plexes in any combination of units. Offers your original cost plus $5,000. Everyone may sell any number of properties at this price. If you sell, pay off the related mortgage and give up the cash flow on this property.", - "refixed",true,5000,"Plex"); + "refixed",5000,"Plex"); private static MarketCard REFixed9 = new MarketCard("Plex Buyer", "Buyer looking for all Apartment and Plexes in any combination of units. Offers your original cost plus $1,000. Everyone may sell any number of properties at this price. If you sell, pay off the related mortgage and give up the cash flow on this property.", - "refixed",true,1000,"Plex"); + "refixed",1000,"Plex"); private static MarketCard REFixed10 = new MarketCard("Plex Buyer", "Buyer looking for all Apartment and Plexes in any combination of units. Offers your original cost plus $20,000. Everyone may sell any number of properties at this price. If you sell, pay off the related mortgage and give up the cash flow on this property.", - "refixed",true,20000,"Plex"); + "refixed",20000,"Plex"); private static MarketCard REFixed11 = new MarketCard("Plex Buyer", "Buyer looking for all Apartment and Plexes in any combination of units. Offers your original cost plus $10,000. Everyone may sell any number of properties at this price. If you sell, pay off the related mortgage and give up the cash flow on this property.", - "refixed",true,10000,"Plex"); + "refixed",10000,"Plex"); //aoffer - value is amount of money you get for selling each unit private static MarketCard REHOffer1 = new MarketCard("House or Condo Buyer - 2BR/1BA", "You are offered $45,000 for a 2Br/1Ba House or Condo. Buyer has their own financing. Everyone may sell any number of properties at this price. If you sell, pay off the related mortgage and give up the cash flow on this property.", - "hoffer",true,45000,"2Br1Ba"); + "hoffer",45000,"2Br1Ba"); private static MarketCard REHOffer2 = new MarketCard("House or Condo Buyer - 2BR/1BA", "You are offered $65,000 for a 2Br/1Ba House or Condo. Buyer has their own financing. Everyone may sell any number of properties at this price. If you sell, pay off the related mortgage and give up the cash flow on this property.", - "hoffer",true,65000,"2Br1Ba"); + "hoffer",65000,"2Br1Ba"); private static MarketCard REAOffer1 = new MarketCard("Apartment House Buyer", "Buyer offers $25,000 per unit for all units in apartment houses of any size. (His 1031 tax-deferred exchange time is running out.) Buyer has their own financing. Everyone may sell any number of properties at this price. If you sell, pay off the related mortgage and give up the cash flow on this property.", - "aoffer",true,25000,"Plex"); + "aoffer",25000,"Plex"); private static MarketCard REAOffer2 = new MarketCard("Apartment House Buyer", "Buyer offers $45,000 per unit for all units in apartment houses of any size. (His 1031 tax-deferred exchange time is running out.) Buyer has their own financing. Everyone may sell any number of properties at this price. If you sell, pay off the related mortgage and give up the cash flow on this property.", - "aoffer",true,45000,"Plex"); + "aoffer",45000,"Plex"); private static MarketCard REAOffer3 = new MarketCard("Apartment House Buyer", "REIT offers $30,000 per unit for all units in apartment houses of 12 units or more. Buyer has capital from the sale of another apartment complex. Everyone may sell any number of properties at this price. If you sell, pay off the related mortgage and give up the cash flow on this property.", - "aoffer",true,30000,"Plex"); + "aoffer",30000,"Plex"); private static MarketCard REAOffer4 = new MarketCard("Apartment House Buyer", "REIT offers $40,000 per unit for all units in apartment houses of 12 units or more. Buyer has capital from the sale of another apartment complex. Everyone may sell any number of properties at this price. If you sell, pay off the related mortgage and give up the cash flow on this property.", - "aoffer",true,40000,"Plex"); + "aoffer",40000,"Plex"); + private Stack _marketCardStack; public MarketStack() - { - MarketCard[] marketCardArray = {Profit1, Profit2, + { + + MarketCard[] marketCardArray = {//Profit1, Profit2, //Gold1, Gold2, Gold3, Gold4, Expense1, Expense2, Expense3, Expense4, Expense5, //Stock1, Stock2, Stock3, Stock4, @@ -153,48 +156,38 @@ public MarketStack() REHOffer1, REHOffer2, REAOffer1, REAOffer2, REAOffer3, REAOffer4}; randomizeCards(marketCardArray); + List list = Arrays.asList(marketCardArray); + Stack MarketCardStack = new Stack(); + MarketCardStack.addAll(list); + + _marketCardStack = MarketCardStack; } //profit MarketCard - value is how much $ is added /* - * okay a lot of this is pseudocode kinda - * pretty much all of it - * also we spelled financial wrong in the class - * * * * */ + private static MarketCard currentcard = new MarketCard(null, null, null, 1, null); + public void Action(Player player){ - currentcard = marketCardArray.pop(); + currentcard = _marketCardStack.pop(); currentcard.display(); //will be a method in MarketCard to display the GUI for the card - if currentcard.getType() == "profit"{ - if currentcard.doesAffectAll() { - for i in players { - i.FinacialStatement.assets += currentcard.getValue(); - } + if (currentcard.getType() == "expense"){ + //This needs to ONLY ACCESS the financial statement of the current player + if (FinancialStatement.assets <= currentcard.getValue()){ + FinancialStatement.assets = 0; } else { - player.FinacialStatement.assets += currentcard.getValue(); - } - } - else if currentcard.getType() == "expense"{ - // all only affect current player - player.FinacialStatement.assets -= currentcard.getValue(); - //what if they dont have enough? will we have negative $$ or a forced bank loan - } - else if currentcard.getType() == "stock"{ - //all affect everyone - - for i in players { - if i.finacialstatement.stock contains currentcard.getStock(){ - //prompt the player with the decision to sell - //if yes, sell # of stocks at price - } + FinancialStatement.assets -= currentcard.getValue(); } - } - else if currentcard.getType() == "repercent"{ + + }}} + // i cant do anything other than expenses until financial statement is done :) + + /* else if (currentcard.getType() == "repercent"){ // they all affect everyone for i in players { if i.finacialstatement.properties contains currentcard.getAddit(){ @@ -203,7 +196,7 @@ public void Action(Player player){ } } - else if currentcard.getType() == "refixed"{ + else if (currentcard.getType() == "refixed"){ // they all affect everyone for i in players { if i.finacialstatement.properties contains currentcard.getAddit(){ @@ -227,5 +220,5 @@ public void Action(Player player){ */ -} + diff --git a/src/model/SmallDealStack.java b/src/model/SmallDealStack.java index 2c3460f..37ca9f5 100644 --- a/src/model/SmallDealStack.java +++ b/src/model/SmallDealStack.java @@ -1,5 +1,9 @@ package model; +import java.util.Arrays; +import java.util.List; +import java.util.Stack; + public class SmallDealStack extends CardStack { private static DealCard SD01 = new DealCard("", @@ -116,16 +120,22 @@ public class SmallDealStack extends CardStack private static DealCard SD38 = new DealCard("", "", , , , ); + private Stack _bigDealStack; public SmallDealStack() { DealCard[] sdArray = {SD01, SD02, SD03, SD04, SD05, SD06, SD07, SD08, SD09, SD10, - SD11, SD12, SD13, SD14, SD15, SD16, SD17, SD18, SD19, SD20, - SD21, SD22, SD23, SD24, SD25, SD26, SD27, SD28, SD29, SD30, - SD31, SD32, SD33, SD34, SD35, SD36, SD37, SD38}; + SD11, SD12, SD13, SD14, SD15, SD16, SD17, SD18, SD19, SD20, + SD21, SD22, SD23, SD24, SD25, SD26, SD27, SD28, SD29, SD30, + SD31, SD32, SD33, SD34, SD35, SD36, SD37, SD38}; super.randomizeCards(sdArray); - + List list = Arrays.asList(sdCardArray); + Stack SDCardStack = new Stack(); + SDCardStack.addAll(list); + + _bigDealStack = SDCardStack; } + }