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/DoodadTile.java
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
39 lines (33 sloc)
848 Bytes
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.*; | |
public class DoodadTile extends Tile | |
{ | |
private static DoodadStack _doodadStack; | |
public DoodadTile(String name, int boardIndex) | |
{ | |
super(name, boardIndex); | |
_doodadStack = new DoodadStack(); | |
} | |
@Override | |
public void getLandedOn(Player p) | |
{ | |
FinancialStatement f = p.getFinancialStatement(); | |
DoodadCard dc = _doodadStack.pickCard(); | |
DoodadCardWindow DoodadCardWindow = new DoodadCardWindow(); | |
DoodadCardWindow.showButtonDemo(); | |
int amount = dc.getValue(); | |
if (f.getCashBalance() > amount) | |
{ | |
f.increaseCashBalance(-amount); | |
} | |
else if(f.getCashBalance() < amount) | |
{ | |
f.setCashBalance(0); | |
} | |
// Pop next card | |
// Get cash out from card | |
// Check if player has enough money to pay in full | |
// If yes: Take cash from player | |
// Otherwise set players cash balance to 0 | |
} | |
} |