-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBag.java
More file actions
67 lines (51 loc) · 1.8 KB
/
Bag.java
File metadata and controls
67 lines (51 loc) · 1.8 KB
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
67
import java.util.*;
public class Bag {
public static String name;
public static ArrayList<Pokemon> bag;
public static ArrayList<Ball> ball;
public Bag() {
bag = new ArrayList<Pokemon>();
ball = new ArrayList<Ball>();
}
public void addBag(String name) {
Bag.name = name;
// System.out.println(name);
}
public static String bagString() {
return name;
}
public static ArrayList<Ball> chooseBall() {
return ball;
}
public ArrayList<Ball> countBall(){
PokeBall pokeball = new PokeBall("Pokeball");
Quickball quickball = new Quickball("Quickball");
Timerball timerball = new Timerball("Timerball");
Ultraball ultraball = new Ultraball("Ultraball");
Masterball masterball = new Masterball("Masterball");
for(Ball b : ball){
if(b.getName() == "Pokeball"){
int num = pokeball.getNumber() + 1 ;
pokeball.setNumber(num);
}
else if(b.getName() == "Quickball"){
int num = quickball.getNumber() + 1 ;
pokeball.setNumber(num);
}
else if(b.getName() == "Timerball"){
int num = timerball.getNumber() + 1 ;
pokeball.setNumber(num);
}
else if(b.getName() == "Ultraball"){
int num = ultraball.getNumber() + 1 ;
pokeball.setNumber(num);
}
else if(b.getName() == "Masterball"){
int num = masterball.getNumber() + 1 ;
pokeball.setNumber(num);
}
}
//System.out.println(ball);
return ball;
}
}