Пример #1
0
        public Vector2i?GetFirstNonFullItemLocations(RawItem item)
        {
            var v = GetAllNonFullItemLocations(item);

            if (v.Length == 0)
            {
                return(null);
            }
            return(v[0]);
        }
Пример #2
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());
        }
Пример #3
0
 public bool RemoveItem(RawItem i)
 {
     return(RemoveItem(new Item(i, 1)));
 }
Пример #4
0
 public bool AddItem(RawItem i)
 {
     return(AddItem(new Item(i, 1)));
 }
Пример #5
0
 public Item(RawItem rawitem, int amt)
 {
     this.rawitem = rawitem;
     this.amt     = amt;
 }
Пример #6
0
 public Item(RawItem rawitem) : this(rawitem, 1)
 {
 }