Esempio n. 1
0
        /// <summary>
        /// Adds an item to the specified slot with the given amount.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="slot"></param>
        /// <param name="amount"></param>
        public void AddItemTo(string name, int slot, int amount)
        {
            ItemDataBlock byName = DatablockDictionary.GetByName(name);

            if (byName != null)
            {
                Inventory.Slot.Kind place = Inventory.Slot.Kind.Default;
                this._inv.AddItemSomehow(byName, new Inventory.Slot.Kind?(place), slot, amount);
            }
        }
Esempio n. 2
0
 private static Loadout.Entry[] LoadEntryArray(Loadout.Entry[] array, Inventory.Slot.Kind kind)
 {
     array = array ?? Loadout.Empty.EntryArray;
     for (int i = 0; i < (int)array.Length; i++)
     {
         Loadout.Entry entry = array[i];
         entry.inferredSlotKind   = kind;
         entry.inferredSlotOfKind = i;
     }
     return(array);
 }
Esempio n. 3
0
        /// <summary>
        /// Adds an item to the specified slot with the given amount.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="slot"></param>
        /// <param name="amount"></param>
        public void AddItemTo(string name, int slot, int amount)
        {
            ItemDataBlock byName = DatablockDictionary.GetByName(name);

            if (byName != null)
            {
                Inventory.Slot.Kind belt = Inventory.Slot.Kind.Default;
                if ((slot > 0x1d) && (slot < 0x24))
                {
                    belt = Inventory.Slot.Kind.Belt;
                }
                else if ((slot >= 0x24) && (slot < 40))
                {
                    belt = Inventory.Slot.Kind.Armor;
                }
                this._inv.AddItemSomehow(byName, new Inventory.Slot.Kind?(belt), slot, amount);
            }
        }
Esempio n. 4
0
        public void AddItemTo(string name, int slot, int amount)
        {
            ItemDataBlock byName = DatablockDictionary.GetByName(name);

            if (byName != null)
            {
                Inventory.Slot.Kind value = Inventory.Slot.Kind.Default;
                if (slot > 29 && slot < 36)
                {
                    value = Inventory.Slot.Kind.Belt;
                }
                else if (slot >= 36 && slot < 40)
                {
                    value = Inventory.Slot.Kind.Armor;
                }
                this._inv.AddItemSomehow(byName, new Inventory.Slot.Kind?(value), slot, amount);
            }
        }
Esempio n. 5
0
 public Inventory.Slot.Preference InventorySlotPreference(Inventory.Slot.Kind kind, bool stack, Inventory.Slot.KindFlags flags)
 {
     return(Inventory.Slot.Preference.Define(kind, stack, flags));
 }