public void setItemFromInventoryToEquipment(int _InventoryPosition, int _EquipmentPosition) { ItemObject var_ToRemove = null; foreach (ItemObject var_ItemObject in this.inventory.Items) { if (var_ItemObject.PositionInInventory == _InventoryPosition) { if (var_ItemObject is EquipmentObject) { var_ItemObject.PositionInInventory = _EquipmentPosition; this.Body.setEquipmentObject((EquipmentObject)var_ItemObject); var_ToRemove = var_ItemObject; } } } if (var_ToRemove != null) { this.inventory.Items.Remove(var_ToRemove); Configuration.Configuration.networkManager.addEvent(new GameLibrary.Connection.Message.UpdateCreatureInventoryMessage(this.Id, this.inventory), GameMessageImportance.VeryImportant); Configuration.Configuration.networkManager.addEvent(new GameLibrary.Connection.Message.UpdateAnimatedObjectBodyMessage(this.Id, this.Body), GameMessageImportance.VeryImportant); } }
public void guiSetItemToInventory(ItemObject _ItemObject, int _FieldId) { this.inventory.itemDropedInInventory(this, _ItemObject, _FieldId); this.inventory.InventoryChanged = true; }