-
Notifications
You must be signed in to change notification settings - Fork 0
/
decision.java
66 lines (48 loc) · 2.36 KB
/
decision.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import java.util.Scanner;
public class decision {
public stackEnvironment tileBusinessToUtilize;
public environmenthealth healthToUtilize;
// my idea:
// to make this class interact with playerinterface, for everytime we call a
// function, we then afterwards make stackenvironment =
//--decision.stackenviornmentChanged inside of the playerinterface
// --same with health!
public decision(stackEnvironment tileBusinessToUtilize, environmenthealth healthToUtilize) {
this.healthToUtilize = healthToUtilize;
this.tileBusinessToUtilize = tileBusinessToUtilize;
}
/**
*
* remember that in playerinterface, do
* taxoption() 1st
* tilebusinesses = decision.tileBusinessToUtilize; 2nd or 3rd
* environmentHealth = decision.healthToUtilize; 2nd or 3rd
*
* @param scanner
* @param tileBusinessToUtilize
* @param healthToUtilize
* @return gives you how much money you get if you decide to tax all your businesses or not
*/
public int taxOption(Scanner scanner, stackEnvironment newTileBusinessesToTransForm, environmenthealth newHealthToTransForm) {
System.out.println("Would you like to tax all of your businesses and housing? say yes or otherwise just input something else to say no: ");
// this is just a sample of having the choice to tax your citizens.
String taxChoice = scanner.nextLine().toLowerCase();
// doing our taxes if we said yes.
if (taxChoice.equals("yes")) {
int amountOfBusinessTileMoneyBefore = newTileBusinessesToTransForm.getSumOfProperty("amountOfMoney");
newTileBusinessesToTransForm.impactTileBusinessProperties("amountOfMoney", -5, -10);
int amountOfBusinessTileMoneyAfter = newTileBusinessesToTransForm.getSumOfProperty("amountOfMoney");
int amountOfMoneyYouGot = amountOfBusinessTileMoneyBefore - amountOfBusinessTileMoneyAfter;
// change our current health and stack environment to be what we've changed
this.tileBusinessToUtilize = newTileBusinessesToTransForm;
this.healthToUtilize = newHealthToTransForm;
System.out.println("you have collected a total of " + amountOfMoneyYouGot + "$ for your tax money");
// gives you amount of money
return amountOfMoneyYouGot;
}
this.tileBusinessToUtilize = newTileBusinessesToTransForm;
this.healthToUtilize = newHealthToTransForm;
// else just return 0;
return 0;
}
}