Skip to content

Commit

Permalink
Fixed market cards. Added the descriptions to the arguments of the cards
Browse files Browse the repository at this point in the history
so they can be accessed later.
  • Loading branch information
Joe authored and Joe committed Mar 3, 2017
1 parent 7be7b0d commit 9b0e473
Show file tree
Hide file tree
Showing 5 changed files with 141 additions and 88 deletions.
Binary file modified bin/controller/Cashflow.class
Binary file not shown.
6 changes: 3 additions & 3 deletions src/controller/Cashflow.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ public class Cashflow
{
public static void main(String[] args)
{
BigDealStack bds = new BigDealStack();
MarketStack ms = new MarketStack();

int initialSize = bds.getSize();
int initialSize = ms.getSize();
for(int i=0; i<initialSize; i++)
{
int num = i+1;
System.out.println(num + ": " + bds.pop().getTitle());
System.out.println(num + ": " + ((MarketCard) ms.pop()).getDescription()); //Always going to need this cast when getting description unfortunately
}
}
}
1 change: 0 additions & 1 deletion src/model/Card.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,5 @@ public String getTitle()
{
return _title;
}


}
11 changes: 9 additions & 2 deletions src/model/MarketCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,25 @@

public class MarketCard extends Card
{
private String _description;
private String _type;
private boolean _affectAll;
private int _value;

public MarketCard(String title, String type, boolean affectAll, int value)
public MarketCard(String title, String description, String type, boolean affectAll, int value)
{
super(title);
_description = description;
_type = type;
_affectAll = affectAll;
_value = value;
}


public String getDescription()
{
return _description;
}

public String getType()
{
return _type;
Expand Down
Loading

0 comments on commit 9b0e473

Please sign in to comment.