private void changeWeapon(Hero hero) { var equipmentChoiceWindow = new EquipmentChoiceWindow(_Inventory); equipmentChoiceWindow.ShowDialog(); int equipInventoryIndex = equipmentChoiceWindow.getChoiceFromSelect(); if (_Inventory.findEquipmentByIndex(equipInventoryIndex).getIsWeapon()) { _Equipment = hero.getWeapon().unEquip(hero); hero.setWeapon(_Inventory.findEquipmentByIndex(equipInventoryIndex)); hero.getWeapon().equip(hero); _Inventory.removeFromEquipment(equipInventoryIndex); _Inventory.addToEquipmentByIndex(equipInventoryIndex, _Equipment); } else { MessageBox.Show("Cannot equip something that is not a weapon to this slot"); } updateVisuals(); }