-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathItem.cs
48 lines (44 loc) · 1.08 KB
/
Item.cs
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
using System;
using System.Drawing;
namespace INVedit
{
public class Item
{
public short ID { get; set; }
public byte Count { get; set; }
public byte Slot { get; set; }
public short Damage { get; set; }
public bool Known { get; set; }
public string Name { get; set; }
public bool Stackable { get; set; }
public short MaxDamage { get; set; }
public Image Image { get; set; }
public Item(short id)
: this(id, 1, 0, 0) { }
public Item(short id, byte count)
: this(id, count, 0, 0) { }
public Item(short id, byte count, byte slot)
: this(id, count, slot, 0) { }
public Item(short id, byte count, byte slot, short damage)
{
ID = id;
Count = count;
Slot = slot;
Damage = damage;
if (Data.items.ContainsKey(id)) {
Data.Item item = Data.items[id];
Known = true;
Name = item.name;
Stackable = item.stackable;
MaxDamage = item.maxDamage;
Image = Data.list.Images[item.imageIndex];
} else {
Name = "Unknown item "+id;
Known = false;
Stackable = false;
MaxDamage = 0;
Image = Data.unknown;
}
}
}
}