Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
test
  • Loading branch information
jrb10014 committed Apr 28, 2015
1 parent 1d32c1d commit 1edbead
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/MockGui.java
Expand Up @@ -294,7 +294,8 @@ public class MockGui extends JPanel{
for(int i=1; i<map.getTF().quantity; i++){
if( (map.getTF().getTowerArray()[i].getTowerXlocation() == local[0]) && (map.getTF().getTowerArray()[i].getTowerYlocation() == local[1])){
//TODO //how to destroy tower?
map.getStatGui().payDay(map.getTF().getTowerArray()[i]._sellCost);
map.getTF().getTowerArray()[i].moveOffToSell();
map.getStatGui().payDay(map.getTF().getTowerArray()[i].getSellValue());
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/StatGui.java
Expand Up @@ -19,6 +19,7 @@ public class StatGui extends JPanel implements ActionListener{
JLabel hpLabel, moneyLabel, towersnumLabel, sellLabelBasic, sellLabelAOE, upgradeLabelBasic, upgradeLabelAOE;
JButton buttonAOETower, buttonBasicTower, buttonSellTower, buttonUpgradeTower;
public int towerPlacerVar = 1; //1:Basic, 2:AOE, 3:Sell, 4:Upgrade
public int notTowers = 1;

public StatGui (int x, int y) {
X = x;
Expand Down Expand Up @@ -159,7 +160,7 @@ public class StatGui extends JPanel implements ActionListener{
}

public void updateNumTowers(){
towersnumLabel.setText("[# of Towers]: " + map.TF.quantity);
towersnumLabel.setText("[# of Towers]: " + (map.TF.quantity - notTowers));
}

public void updateBasicSellLabel(){
Expand Down
6 changes: 6 additions & 0 deletions src/TowerMock.java
Expand Up @@ -169,6 +169,12 @@ public class TowerMock{
return _sellCost * _level;
}

public void moveOffToSell() {
_xlocation = -1000;
_range = 0;
_map.getStatGui().notTowers++;
}

public int getBuyCost() {
return _buyCost;
}
Expand Down

0 comments on commit 1edbead

Please sign in to comment.