-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathItem.java
More file actions
73 lines (62 loc) · 1.25 KB
/
Copy pathItem.java
File metadata and controls
73 lines (62 loc) · 1.25 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
62
63
64
65
66
67
68
69
70
71
72
73
import java.io.Serializable;
public class Item implements Serializable
{
//types: mission, consumable, meele, range, armour, tool, schrott
private String name;
private String type;
private int power;
private int Goldwert;
private int amount=1;
public Item(String n, String t, int p, int w)
{
name = n;
type = t;
power = p;
Goldwert = w;
}
public Item(String n)
{
name=n;
}
public Item(String n, String t, int p, int w, int a)
{
name = n;
type = t;
power = p;
Goldwert = w;
amount = a;
}
public void changeAmount(int a)
{
amount = amount+a;
}
public String getName()
{
return name;
}
public String getType()
{
return type;
}
public int getPower()
{
return power;
}
public int getAmount()
{
return amount;
}
public int getWert()
{
return Goldwert;
}
public boolean equals(Object obj){
if(obj instanceof Item){
Item i = (Item) obj;
return (name.equals(i.getName()) );
}
else{
return false;
}
}
}