Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 70 lines (65 sloc) 1.373 kB
c46ecfd Initial commit
Sven Braune authored
1 using System;
2 using System.Drawing;
3
4 namespace INVedit
5 {
6 public class Item
7 {
91bd63b Version 0.9.9
Sven Braune authored
8 Data.Item item {
9 get {
10 if (Data.items.ContainsKey(ID)) {
11 if (Data.items[ID].ContainsKey(Damage))
12 return Data.items[ID][Damage];
13 else return Data.items[ID][0];
14 } else return null;
15 }
16 }
17
c46ecfd Initial commit
Sven Braune authored
18 public short ID { get; set; }
19 public byte Count { get; set; }
20 public byte Slot { get; set; }
21 public short Damage { get; set; }
22
91bd63b Version 0.9.9
Sven Braune authored
23 public bool Known { get { return (item != null); } }
24 public bool Alternative {
25 get {
26 if (!Known) return false;
27 return (Data.items[ID].Count > 1);
28 }
29 }
30 public string Name {
31 get {
32 if (!Known) return "Unknown item "+ID;
33 return item.name;
34 }
35 }
36 public byte Stack {
37 get {
38 if (!Known) return 64;
39 return item.stack;
40 }
41 }
42 public short MaxDamage {
43 get {
44 if (!Known) return 0;
45 return item.maxDamage;
46 }
47 }
48 public Image Image {
49 get {
50 if (!Known) return Data.unknown;
51 return Data.list.Images[item.imageIndex];
52 }
53 }
c46ecfd Initial commit
Sven Braune authored
54
55 public Item(short id)
56 : this(id, 1, 0, 0) { }
57 public Item(short id, byte count)
58 : this(id, count, 0, 0) { }
59 public Item(short id, byte count, byte slot)
60 : this(id, count, slot, 0) { }
61 public Item(short id, byte count, byte slot, short damage)
62 {
63 ID = id;
64 Count = count;
65 Slot = slot;
66 Damage = damage;
67 }
68 }
69 }
Something went wrong with that request. Please try again.