-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathItemObject.java
More file actions
39 lines (31 loc) · 759 Bytes
/
ItemObject.java
File metadata and controls
39 lines (31 loc) · 759 Bytes
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
package my.quarker;
import net.slashie.libjcsi.CSIColor;
/**
*
* @author ehoward
*/
public class ItemObject extends BaseObject {
int quantity;
public ItemObject() {
super("Item", '*', true, CSIColor.VEGAS_GOLD);
quantity = 1;
}
public ItemObject(String name, char rep, boolean pass, CSIColor color, int quant){
super(name, rep, pass, color);
quantity = quant;
}
public void setQuantity(int num) {
if (num >= 0) {
quantity = num;
} else {
quantity = 0;
}
}
public void deepCopy(ItemObject obj){
deepCopy((BaseObject)obj);
quantity = obj.quantity;
}
public int getQuantity() {
return quantity;
}
}