-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBag.java
More file actions
83 lines (73 loc) · 2.2 KB
/
Copy pathBag.java
File metadata and controls
83 lines (73 loc) · 2.2 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
package edu.kit.informatik;
import java.util.ArrayList;
/**
* The type Bag containing all tokens.
*
* @author John Dederer
* @version 1.0
*/
public class Bag {
/**
* The Bag.
*/
private ArrayList<Token> bag;
/**
* Instantiates a new Bag.
*/
public Bag() {
this.bag = new ArrayList<>();
}
/**
* Gets bag.
*
* @return the bag
*/
public ArrayList<Token> getBag() {
return bag;
}
/**
* Sets bag.
*
* @param bag the bag
*/
public void setBag(ArrayList<Token> bag) {
this.bag = bag;
}
/**
* Fills bag with 16 unique tokens.
*/
public void fillBag() {
this.bag.add(new Token("black", "cornered", "small", "hollow", 0));
this.bag.add(new Token("black", "cornered", "small", "solid", 1));
this.bag.add(new Token("black", "cornered", "big", "hollow", 2));
this.bag.add(new Token("black", "cornered", "big", "solid", 3));
this.bag.add(new Token("black", "cylindrical", "small", "hollow", 4));
this.bag.add(new Token("black", "cylindrical", "small", "solid", 5));
this.bag.add(new Token("black", "cylindrical", "big", "hollow", 6));
this.bag.add(new Token("black", "cylindrical", "big", "solid", 7));
this.bag.add(new Token("white", "cornered", "small", "hollow", 8));
this.bag.add(new Token("white", "cornered", "small", "solid", 9));
this.bag.add(new Token("white", "cornered", "big", "hollow", 10));
this.bag.add(new Token("white", "cornered", "big", "solid", 11));
this.bag.add(new Token("white", "cylindrical", "small", "hollow", 12));
this.bag.add(new Token("white", "cylindrical", "small", "solid", 13));
this.bag.add(new Token("white", "cylindrical", "big", "hollow", 14));
this.bag.add(new Token("white", "cylindrical", "big", "solid", 15));
}
/**
* Remove token from bag.
*
* @param token to remove
*/
public void removeToken(Token token) {
this.bag.remove(token);
}
/**
* Add token to bag.
*
* @param token the token
*/
public void addToken(Token token) {
this.bag.add(token);
}
}