public Vector2i?GetFirstNonFullItemLocations(RawItem item) { var v = GetAllNonFullItemLocations(item); if (v.Length == 0) { return(null); } return(v[0]); }
public Vector2i[] GetAllNonFullItemLocations(RawItem item) { var l = new List <Vector2i>(); for (int j = 0; j < Items.GetLength(1); j++) { for (int i = 0; i < Items.GetLength(0); i++) { if (Items[i, j].rawitem.id == item.id && Items[i, j].amt < Items[i, j].rawitem.attribs.stackSize) { l.Add(new Vector2i(i, j)); } } } return(l.ToArray()); }
public bool RemoveItem(RawItem i) { return(RemoveItem(new Item(i, 1))); }
public bool AddItem(RawItem i) { return(AddItem(new Item(i, 1))); }
public Item(RawItem rawitem, int amt) { this.rawitem = rawitem; this.amt = amt; }
public Item(RawItem rawitem) : this(rawitem, 1) { }