-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTask.java
43 lines (36 loc) · 1.05 KB
/
Task.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
import java.util.Arrays;
public class Task
{
private int id;
private String type;
private int[] resourceReward;
private String specialReward;
private String[] allType = new String[]{"Composition", "Sortie", "Exercise", "Expedition", "Supply", "Arsenal", "Modernization"};
public Task () //overload
{
id = -1; type = "No Type"; resourceReward = new int[]{0,0,0,0}; specialReward = "No Special Reward";
}
public Task (int i, String s, int[] rr, String sr)
{
id = i; type = s; resourceReward = rr.clone(); specialReward = sr;
}
public void setTask (int i, String s, int[] rr, String sr)
{
id = i; type = s; resourceReward = rr.clone(); specialReward = sr;
}
public void printTask ()
{
System.out.println("[ ID:" + id + ", Type:" + type + ", Resource Reward: ");
this.printResourceReward();
System.out.println(", " + specialReward + " ]");
}
private void printResourceReward()
{
System.out.print("[ ");
for (int i = 0; i < 4; i++)
{
System.out.print(resourceReward[i]);
}
System.out.print(" ]");
}
}