Skip to content
Permalink
deaa7291cf
Switch branches/tags

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?
Go to file
 
 
Cannot retrieve contributors at this time
77 lines (60 sloc) 1.67 KB
package model;
import view.*;
import controller.*;
import java.util.Scanner;
public class DealTile extends Tile
{
private static SmallDealStack _smallDealStack = new SmallDealStack();;
private static BigDealStack _bigDealStack = new BigDealStack();
private static int _stockPrice;
public DealTile(String type, int boardIndex)
{
super(type, boardIndex);
}
@Override
public void getLandedOn(Player p)
{
// TODO
// Ask user to decide big/small deal:
CharityWindow charityWindow = new CharityWindow();
charityWindow.showButtonDemo();
while(!charityWindow.hasAnswered)
{
try {
Thread.sleep(200);
} catch(InterruptedException e) {
}
}
System.out.println(charityWindow.doesDonate);
// Pick card from big/small deal stack:
Card c;
if(charityWindow.doesDonate)
{
c = _smallDealStack.pickCard();
}
else
{
c = _bigDealStack.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:
System.out.println(charityWindow.hasAnswered);
charityWindow = null;
}
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)
{
}
}