-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathShelf.java
42 lines (39 loc) · 867 Bytes
/
Shelf.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
package lab5;
import java.util.ArrayList;
public class Shelf extends Thing {
Wall Wall;
static Shelf[] Shelves = new Shelf [100];
ArrayList <Jar> Jars = new ArrayList <Jar>();
public Shelf (Wall Wall, String Name, Integer Number ){
this.Name = Name;
this.Wall = Wall;
Shelves[Number] = this;
if (this.Wall != null){
Wall.Shelfs.add (this);
}
if (Jars.size() == 0){
IsEmpty = true;
}
else IsEmpty = false;
}
@Override
public void ChangeMood(Human Human) {
// TODO Auto-generated method stub
}
public static Shelf parseShelf(String n) {
// TODO Auto-generated method stub
for (Shelf i:Shelves){
if (i!= null) {
//+System.out.println(i.Name);
if (n != i.Name){
continue;
}
else return i;
}
}
//ÊÎÑÒÛËÜ
Shelf NewShelf = new Shelf (null, n, 2);
//System.out.println(n);
return NewShelf;
}
}