-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathEveInventoryContainer.cs
56 lines (54 loc) · 1.78 KB
/
EveInventoryContainer.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
49
50
51
52
53
54
55
56
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace EveModel
{
public class EveInventoryContainer : EveObject
{
public EveInventoryContainer(EveObject parent)
{
this.PointerToObject = parent.PointerToObject;
}
public string ShortName
{
get { return this["invController"]["name"].GetValueAs<string>(); }
}
public string Name
{
get { return this["invController"].CallMethod("GetName", new object[0]).GetValueAs<string>(); }
}
public List<EveItem> Items
{
get
{
List<EveItem> items = new List<EveItem>();
foreach (var item in this["invController"].CallMethod("GetItems", new object[0]).GetList<EveObject>())
{
items.Add(new EveItem(item));
}
return items;
}
}
public double Capacity
{
get { return this["invController"].CallMethod("GetCapacity", new object[0])["capacity"].GetValueAs<double>(); }
}
public double UsedCapacity
{
get { return this["invController"].CallMethod("GetCapacity", new object[0])["used"].GetValueAs<double>(); }
}
public void Add(EveItem item)
{
this["invController"].CallMethod("_AddItem", new object[] { item }, true);
}
public void Add(EveItem item, int quantity)
{
this["invController"].CallMethod("_BaseInvContainer__AddItem", new object[] { item.ItemId, item.LocationId, quantity }, true);
}
public void StackAll()
{
this["invController"].CallMethod("StackAll", new object[0], true);
}
}
}