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.
77 lines (60 sloc)
1.67 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 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) | |
{ | |
} | |
} |