-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathItem.java
More file actions
61 lines (58 loc) · 1.42 KB
/
Item.java
File metadata and controls
61 lines (58 loc) · 1.42 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
package Assignment4;
import java.util.ArrayList;
public class Item {
private ArrayList<Item> list = new ArrayList<>();
private String name;
private double weight, value, ID, Durability;
public Item(String name, double weight, double value, double ID, double Durability) {
this.name = name;
this.ID = ID;
this.weight = weight;
this.value = value;
this.Durability = Durability;
}
public ArrayList<Item> getList() {
return list;
}
public void setList(ArrayList<Item> list) {
this.list = list;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public double getWeight() {
return weight;
}
public void setWeight(double weight) {
this.weight = weight;
}
public double getValue() {
return value;
}
public void setValue(double value) {
this.value = value;
}
public double getID() {
return ID;
}
public void setID(double iD) {
ID = iD;
}
public double getDurability() {
return Durability;
}
public void setDurability(double durability) {
Durability = durability;
}
@Override
public String toString() {
return ("Name: | "+this.getName()+
" | ID: "+ this.getID() +
" | Weight: "+ this.getWeight() +
" | Value: " + this.getValue()+
" | Durability: " + this.getDurability());
}
}