diff --git a/bin/controller/Cashflow.class b/bin/controller/Cashflow.class index dee42c4..963de9a 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 4a98248..1e95398 100644 --- a/src/controller/Cashflow.java +++ b/src/controller/Cashflow.java @@ -72,7 +72,10 @@ public class Cashflow private static void testGamePlay() { - GameBoard g = new GameBoard(); + Player p = new Player(); + p.getFinancialStatement().getProfession().getName(); + //GameBoard g = new GameBoard(); + } diff --git a/src/model/FinancialStatement.java b/src/model/FinancialStatement.java index 0508cb9..caf2de0 100644 --- a/src/model/FinancialStatement.java +++ b/src/model/FinancialStatement.java @@ -188,7 +188,10 @@ public class FinancialStatement update(); } - + public Profession getProfession() + { + return _profession; + } } diff --git a/src/model/GameBoard.java b/src/model/GameBoard.java index 672ae2c..0f15b49 100644 --- a/src/model/GameBoard.java +++ b/src/model/GameBoard.java @@ -6,19 +6,22 @@ import model.TileCircularLinkedList.Node; public class GameBoard { + private Professions _profs; + private TileCircularLinkedList _tiles; private static Tile t1 = new DealTile("Deal Tile", 0); - private static Tile t2 = new DoodadTile("Doodad", 1); + private static Tile t2 = new DealTile("Doodad", 1); private static Tile t3 = new DealTile("Deal", 2); - private static Tile t4 = new CharityTile("Charity", 3); - + private static Tile t4 = new DealTile("Charity", 3); - public GameBoard() + public GameBoard(Player... players) { + _profs = new Professions(); _tiles = new TileCircularLinkedList(); _tiles.addTiles(t1, t2, t3, t4); + t1.addPlayers(players); } @@ -41,10 +44,14 @@ public class GameBoard } currentNode = nextNode; } - currentNode.getData().addPlayer(p); + currentNode.getData().addPlayers(p); p.setLocation(currentNode.getData().getBoardIndex()); return passedPaydays; } + public void getProfessions() + { + return _profs; + } } diff --git a/src/model/MarketStack.java b/src/model/MarketStack.java index 031c73b..2a350be 100644 --- a/src/model/MarketStack.java +++ b/src/model/MarketStack.java @@ -3,8 +3,15 @@ import java.util.Arrays; import java.util.Stack; import java.util.List; +/** + * This class contains the content written on the physical + * @author Joe + * + */ + public class MarketStack extends CardStack { + private static final long serialVersionUID = 1L; //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 /* @@ -143,6 +150,7 @@ public class MarketStack extends CardStack 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",40000,"Plex"); + private Stack _marketCardStack; public MarketStack() @@ -163,6 +171,20 @@ public class MarketStack extends CardStack _marketCardStack = MarketCardStack; } + +} + + + + + + + + + + + + //profit MarketCard - value is how much $ is added @@ -170,7 +192,6 @@ public class MarketStack extends CardStack * * * - */ private static MarketCard currentcard = new MarketCard(null, null, null, 1, null); diff --git a/src/model/MarketTile.java b/src/model/MarketTile.java index 3abfb4d..acc2b69 100644 --- a/src/model/MarketTile.java +++ b/src/model/MarketTile.java @@ -2,8 +2,8 @@ package model; public class MarketTile extends Tile { - public MarketTile(String type) { - super(type); + public MarketTile(String type, int boardIndex) { + super(type, boardIndex); // TODO Auto-generated constructor stub } diff --git a/src/model/OwnedRealEstate.java b/src/model/OwnedRealEstate.java index f12842c..4f78db4 100644 --- a/src/model/OwnedRealEstate.java +++ b/src/model/OwnedRealEstate.java @@ -12,7 +12,7 @@ public class OwnedRealEstate _name = name; _price = price; _downPayment = downPayment; - set_cashFlow(cashFlow); + _cashFlow = cashFlow; } public String getName() { @@ -24,7 +24,6 @@ public class OwnedRealEstate } /** - * * @return Returns a positive value for down payment!! */ public int getDownPayment() { diff --git a/src/model/Player.java b/src/model/Player.java index 1686bc0..d8ce3c4 100644 --- a/src/model/Player.java +++ b/src/model/Player.java @@ -2,22 +2,23 @@ package model; public class Player { - private FinancialStatement _fs; //financial statement of user - //idNumber? -// public boolean _charity; - private int _CharityCount; //charity counter - private int _DownsizeCount; //downsize counter + private FinancialStatement _fs; + private int _charityCount; //charity counter + private int _downsizeCount; //downsize counter private int _location; - private boolean _winner = false; + private boolean _hasWon; - public Player() { //constructor - // TODO: Pick profession + public Player() { + + _charityCount = 0; + _downsizeCount = 0; _location = 0; + _hasWon = false; } public boolean hasWon() { - return _winner; + return _hasWon; } public FinancialStatement getFinancialStatement() @@ -37,6 +38,30 @@ public class Player public int getLocation() { return this._location; } + + + public int getCharityCount() + { + return _charityCount; + } + + + public void decrementCharityCount() + { + _charityCount--; + } + + + public int getDownsizeCount() + { + return _downsizeCount; + } + + + public void decrememntDownsizeCount() + { + _downsizeCount--; + } diff --git a/src/model/Professions.java b/src/model/Professions.java index 2d8b6b3..f60eec2 100644 --- a/src/model/Professions.java +++ b/src/model/Professions.java @@ -4,49 +4,50 @@ import java.util.*; public class Professions { - Profession Nurse = new Profession("Nurse", 3100, 600, 400, 100, 100, 200, 600, 0, 0, 200, 500, 47000, 6000, 5000, 4000); + private static 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, + private static Profession Teacher = new Profession("Teacher", 3300, 500, 500, 100, 100, 200, 700, 0, 0, 200, 400, 50000, 12000, 5000, 4000); - Profession TruckDriver = new Profession("TruckDriver", 2500, 500, 400, 0, 100, 100, 600, + private static Profession TruckDriver = new Profession("TruckDriver", 2500, 500, 400, 0, 100, 100, 600, 0, 0, 200, 800, 38000, 0, 4000, 3000); - Profession Secretary = new Profession("Secretary", 2500, 500, 400, 0, 100, 100, 600, 0, 0, + private static Profession Secretary = new Profession("Secretary", 2500, 500, 400, 0, 100, 100, 600, 0, 0, 100, 700, 38000, 0, 4000, 3000); - Profession Engineer = new Profession("Engineer", 4900, 1000, 700, 100, 200, 200, 1000, 0, 0, + private static Profession Engineer = new Profession("Engineer", 4900, 1000, 700, 100, 200, 200, 1000, 0, 0, 200, 400, 75000, 12000, 7000, 5000); - Profession BusinessManager = new Profession("BusinessManager", 4600, 900, 700, 100, 100, 200, + private static Profession BusinessManager = new Profession("BusinessManager", 4600, 900, 700, 100, 100, 200, 1000, 0, 0, 300, 400, 75000, 12000, 6000, 4000); - Profession AirlinePilot = new Profession("AirlinePilot", 9500, 2000, 1000, 0, 300, 700, 2000, + private static Profession AirlinePilot = new Profession("AirlinePilot", 9500, 2000, 1000, 0, 300, 700, 2000, 0, 0, 400, 2500, 90000, 0, 15000, 22000); - Profession Lawyer = new Profession("Lawyer", 7500, 1800, 1100, 300, 200, 200, 1500, 0, 0, 400, + private static Profession Lawyer = new Profession("Lawyer", 7500, 1800, 1100, 300, 200, 200, 1500, 0, 0, 400, 2000, 115000, 78000, 11000, 7000); - Profession PoliceOfficer = new Profession("PoliceOfficer", 3000, 600, 400, 0, 100, 100, 700, 0, 0, + private static Profession PoliceOfficer = new Profession("PoliceOfficer", 3000, 600, 400, 0, 100, 100, 700, 0, 0, 200, 500, 46000, 0, 5000, 3000); - Profession Doctor = new Profession("Doctor", 13200, 3200, 1900, 700, 300, 200, 2000, 0, 0, 700, + private static Profession Doctor = new Profession("Doctor", 13200, 3200, 1900, 700, 300, 200, 2000, 0, 0, 700, 3500, 202000, 150000, 19000, 10000); - Profession Mechanic = new Profession("Mechanic", 2000, 400, 300, 0, 100, 100, 400, 0, 0, 100, + private static Profession Mechanic = new Profession("Mechanic", 2000, 400, 300, 0, 100, 100, 400, 0, 0, 100, 700, 31000, 0, 3000, 3000); - Profession Janitor = new Profession("Janitor", 1600, 300, 200, 0, 100, 100, 300, 0, 0, 100, + private static Profession Janitor = new Profession("Janitor", 1600, 300, 200, 0, 100, 100, 300, 0, 0, 100, 600, 20000, 0, 4000, 3000); - - Profession[] profs = {Nurse, Teacher, TruckDriver, Secretary, Engineer, BusinessManager, + private static Profession[] profs = {Nurse, Teacher, TruckDriver, Secretary, Engineer, BusinessManager, AirlinePilot, Lawyer, PoliceOfficer, Doctor, Mechanic, Janitor}; public Profession playerProf; - public Professions() {} - + public Professions() + { + + } public Profession getProfession() diff --git a/src/model/SmallDealStack.java b/src/model/SmallDealStack.java index 37ca9f5..a60550e 100644 --- a/src/model/SmallDealStack.java +++ b/src/model/SmallDealStack.java @@ -6,134 +6,87 @@ import java.util.Stack; public class SmallDealStack extends CardStack { - private static DealCard SD01 = new DealCard("", - "", - , , , ); - private static DealCard SD02 = new DealCard("", - "", - , , , ); - private static DealCard SD03 = new DealCard("", - "", - , , , ); - private static DealCard SD04 = new DealCard("", - "", - , , , ); - private static DealCard SD05 = new DealCard("", - "", - , , , ); - private static DealCard SD06 = new DealCard("", - "", - , , , ); - private static DealCard SD07 = new DealCard("", - "", - , , , ); - private static DealCard SD08 = new DealCard("", - "", - , , , ); - private static DealCard SD09 = new DealCard("", - "", - , , , ); - private static DealCard SD10 = new DealCard("", - "", - , , , ); - private static DealCard SD11 = new DealCard("", - "", - , , , ); - private static DealCard SD12 = new DealCard("", - "", - , , , ); - private static DealCard SD13 = new DealCard("", - "", - , , , ); - private static DealCard SD14 = new DealCard("", - "", - , , , ); - private static DealCard SD15 = new DealCard("", - "", - , , , ); - private static DealCard SD16 = new DealCard("", - "", - , , , ); - private static DealCard SD17 = new DealCard("", - "", - , , , ); - private static DealCard SD18 = new DealCard("", - "", - , , , ); - private static DealCard SD19 = new DealCard("", - "", - , , , ); - private static DealCard SD20 = new DealCard("", - "", - , , , ); - private static DealCard SD21 = new DealCard("", - "", - , , , ); - private static DealCard SD22 = new DealCard("", - "", - , , , ); - private static DealCard SD23 = new DealCard("", - "", - , , , ); - private static DealCard SD24 = new DealCard("", - "", - , , , ); - private static DealCard SD25 = new DealCard("", - "", - , , , ); - private static DealCard SD26 = new DealCard("", - "", - , , , ); - private static DealCard SD27 = new DealCard("", - "", - , , , ); - private static DealCard SD28 = new DealCard("", - "", - , , , ); - private static DealCard SD29 = new DealCard("", - "", - , , , ); - private static DealCard SD30 = new DealCard("", - "", - , , , ); - private static DealCard SD31 = new DealCard("", - "", - , , , ); - private static DealCard SD32 = new DealCard("", - "", - , , , ); - private static DealCard SD33 = new DealCard("", - "", - , , ); - private static DealCard SD34 = new DealCard("", - "", - , , , ); - private static DealCard SD35 = new DealCard("", - "", - , , , ); - private static DealCard SD36 = new DealCard("", - "", - , , , ); - private static DealCard SD37 = new DealCard("", - "", - , , , ); - private static DealCard SD38 = new DealCard("", - "", - , , , ); + private static final long serialVersionUID = 1L; + + private static DealCard SD01 = new DealCard("Stock - ON2U Entertainment Co.", + "Box office hit by children's division causes record share price. " + + "Historic Trading Range: $10 - 30", + 40, 0, 0, 0); + private static DealCard SD02 = new DealCard("Stock - ON2U Entertainment Co.", + "Strong demand for company's library of old movies leads to good share price. " + + "Historic Trading Range: $10 - 30", + 30, 0, 0, 0); + private static DealCard SD03 = new DealCard("Stock - ON2U Entertainment Co.", + "New director of movie acquisitions brings revived prospects for share price. " + + "Historic Trading Range: $10 - 30", + 20, 0, 0, 0); + private static DealCard SD04 = new DealCard("Stock - ON2U Entertainment Co.", + "Movie buyer fired after third mega-flop! Share sink. Chairman's bonus cancelled." + + "Historic Trading Range: $10 - 30", + 10, 0, 0, 0); + private static DealCard SD05 = new DealCard("Stock - ON2U Entertainment Co.", + "Newest theme park is a huge flop, reports record losses. Share price hits all-time low." + + "Historic Trading Range: $10 - 30", + 5, 0, 0, 0); + private static DealCard SD06 = new DealCard("Condo for Sale - 2Br/1Ba", + "Parents selling 2/1 condo used by their child in college town. " + + "Lots of demand for rentals in this area.", + 40000, 4000, 36000, 140); + private static DealCard SD07 = new DealCard("Condo for Sale - 2Br/1Ba", + "Older 2/1 condo offered by young couple who want to move up to a 3/2 house " + + "due to grouwing family. Available soon.", + 55000, 5000, 50000, 160); + private static DealCard SD08 = new DealCard("Condo for Sale - 2Br/1Ba", + "Excellent 2/1 condo with many extras. Onwer wants to relocate for dream job FAST!" + + "She's moving up- you can too! No Cash Flow, but a possible capital gains opportunity.", + 40000, 1000, 39000, 0); + private static DealCard SD09 = new DealCard("Condo for Sale - 2Br/1Ba", + "Bank foreclosure! 2/1 condo in a desireable neighborhood. Close to jobs and stores." + + "Make offer, favorable financing by bank.", + 40000, 5000, 35000, 220); + private static DealCard SD10 = new DealCard("House for Sale - 2Br/1Ba", + "Nice 2/1 house aailable in a depressed market due to layoffs. Would make a good" + + "investment property for the right buyer.", + 50000, 4000, 46000, 200); + private static DealCard SD11 = new DealCard("House for Sale - 2Br/1Ba", + "Nice 2/1 rental house suddenly available due to estate closing. Well-maintained older " + + "property with existing tenant.", + 65000, 5000, 60000, 160); + private static DealCard SD12 = new DealCard("House for Sale - 2Br/1Ba", + "Low down payment to pick up with 2/1 house. Owner/seller unexpectedly moving out of town." + + " Right person will do well.", + 50000, 3000, 47000, 100); + private static DealCard SD13 = new DealCard("House for Sale - 2Br/1Ba", + "2/1 house in an older area offered by the Highway Department. The market has crashed and the " + + "city MUST sell. No Cash Flow but a possible capital gains opportunity.", + 30000, 1000, 29000, 0); + private static DealCard SD14 = new DealCard("House for Sale - 2Br/1Ba", + "Not lived in for six months, this bank-foreclosed house just reduced. Loan includes " + + "estimated repair costs.", + 50000, 2000, 48000, 200); + private static DealCard SD15 = new DealCard("You Find a Great Deal!", + "Older 2/1 house, reposses by government agency. Ready to go with government financing " + + "and a tenant. Take out a loan if you must, but BUY THIS!", + 35000, 2000, 33000, 220); + private static DealCard SD16 = new DealCard("You Find a Great Deal!", + "Company bought transferred-manager's 2/1 house. No current tenant, it has been on the market" + + "six months and it has just been reduced. Take out a loan if you must, but BUY THIS!", + 45000, 2000, 43000, 250); +// private static DealCard SD17 = new DealCard("", +// "", +// , , , ); + //SD17 for incase we decided to add more or something. 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}; - super.randomizeCards(sdArray); + DealCard[] sdCardArray = {SD01, SD02, SD03, SD04, SD05, SD06, SD07, SD08, SD09, SD10, + SD11, SD12, SD13, SD14, SD15, SD16}; + super.randomizeCards(sdCardArray); List list = Arrays.asList(sdCardArray); Stack SDCardStack = new Stack(); SDCardStack.addAll(list); - - _bigDealStack = SDCardStack; + _bigDealStack = SDCardStack; } diff --git a/src/model/Tile.java b/src/model/Tile.java index 3e37e71..906ad54 100644 --- a/src/model/Tile.java +++ b/src/model/Tile.java @@ -29,9 +29,12 @@ public class Tile } - public void addPlayer(Player p) + public void addPlayers(Player... players) { - _players.add(p); + for(Player p : players) + { + _players.add(p); + } } public void removePlayer(Player p)