/// <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); } }
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); }
/// <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); } }
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); } }
public Inventory.Slot.Preference InventorySlotPreference(Inventory.Slot.Kind kind, bool stack, Inventory.Slot.KindFlags flags) { return(Inventory.Slot.Preference.Define(kind, stack, flags)); }