Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
2102-Group-Project-Spring-2017/src/model/DealTile.java
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
63 lines (49 sloc)
1.39 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package model; | |
import java.util.Scanner; | |
public class DealTile extends Tile | |
{ | |
private static SmallDealStack _smallDealStack; | |
private static BigDealStack _bigDealStack; | |
private static int _stockPrice; | |
public DealTile(String type, int boardIndex) | |
{ | |
super(type, boardIndex); | |
_smallDealStack = new SmallDealStack(); | |
_bigDealStack = new BigDealStack(); | |
} | |
@Override | |
public void getLandedOn(Player p) | |
{ | |
// TODO | |
// For now, using a scanner to interact with user until GUI is ready: | |
// Ask user to decide big/small deal: | |
// Pick card from big/small deal stack: | |
Card c; | |
if(input.equals("1")) | |
{ | |
c = _smallDealStack.pickCard(); | |
} | |
else | |
{ | |
c = _smallDealStack.pickCard(); | |
} | |
// If stock, update price, then ask user if they want to buy and ask everyone if they want to sell: | |
//if(c.getTitle().equals(anObject)) | |
// If property, ask user if they want to do it (and check if they can afford the down payment): | |
// If yes, call ButIncomeProperty method: | |
// Else, do nothing: | |
} | |
public void buyIncomeProperty(Player p, DealCard d) | |
{ | |
FinancialStatement f = p.getFinancialStatement(); | |
OwnedRealEstate newProperty = new OwnedRealEstate(d.getTitle(), d.getCost(), d.getDownPayment(), d.getCashFlowChange()); | |
f.buyProperty(newProperty); | |
} | |
public void updateStockPrice(DealCard d) | |
{ | |
_stockPrice = d.getCost(); | |
} | |
public void buyStock(Player p) | |
{ | |
} | |
} |