-
Notifications
You must be signed in to change notification settings - Fork 0
/
BeltList.java
41 lines (37 loc) · 917 Bytes
/
BeltList.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
/*
0 - White
1 - Yellow
2 - Orange
3 - Green
4 - Blue
5 - Red
6 - Black
*/
/**
* A BeltList object has an array of 7 preset Belts with colors. There are no parameters needed to create it so the default Java constructor will be utilized.
*/
public class BeltList
{
private Belt white = new Belt("WHITE");
private Belt yellow = new Belt("YELLOW");
private Belt orange = new Belt("ORANGE");
private Belt green = new Belt("GREEN");
private Belt blue = new Belt("BLUE");
private Belt red = new Belt("RED");
private Belt black = new Belt("BLACK");
private Belt[] beltList = {white, yellow, orange, green, blue, red, black};
//s
/**
* Returns a chosen belt from the beltList
* @param i the belt index integer
* @return the Belt specified by the index
*/
public Belt get(int i)
{
return beltList[i];
}
public String getString(int i)
{
return beltList[i].toString();
}
}