summaryrefslogtreecommitdiff
path: root/NET/worlds/scape/InventoryItem.java
blob: 22fbd30234c79077173758ff2744764ac2976b08 (plain) (blame)
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
package NET.worlds.scape;

import NET.worlds.network.URL;

public class InventoryItem {
   protected String itemId_;
   protected String itemName_;
   protected int itemQuantity_;
   protected URL itemGraphicLocation_;

   public InventoryItem(String id, String name) {
      this.itemId_ = id;
      this.itemName_ = name;
      this.itemQuantity_ = 1;
   }

   public InventoryItem(String id, String name, int qty) {
      this.itemId_ = id;
      this.itemName_ = name;
      this.itemQuantity_ = qty;
   }

   public InventoryItem(InventoryItem in) {
      this.itemId_ = in.itemId_;
      this.itemName_ = in.itemName_;
      this.itemQuantity_ = in.itemQuantity_;
      this.itemGraphicLocation_ = in.itemGraphicLocation_;
   }

   public String getItemId() {
      return this.itemId_;
   }

   public void setItemId(String id) {
      this.itemId_ = id;
   }

   public String getItemName() {
      return this.itemName_;
   }

   public void setItemName(String name) {
      this.itemName_ = name;
   }

   public int getItemQuantity() {
      return this.itemQuantity_;
   }

   public void setQuantity(int qty) {
      this.itemQuantity_ = qty;
   }

   public URL getItemGraphicLocation() {
      return this.itemGraphicLocation_;
   }

   public void setItemGraphicLocation(URL newLoc) {
      this.itemGraphicLocation_ = newLoc;
   }

   public InventoryItem cloneItem() {
      return new InventoryItem(this);
   }
}