diff --git a/AntiAirCraftGun/AntiAirCraftGun/FormAntiAirCraftGunCollection.cs b/AntiAirCraftGun/AntiAirCraftGun/FormAntiAirCraftGunCollection.cs index 1aac3c3..61b285a 100644 --- a/AntiAirCraftGun/AntiAirCraftGun/FormAntiAirCraftGunCollection.cs +++ b/AntiAirCraftGun/AntiAirCraftGun/FormAntiAirCraftGunCollection.cs @@ -106,7 +106,7 @@ namespace AntiAircraftGun FormAntiAirCraftGun form = new(); if (form.ShowDialog() == DialogResult.OK) { - if (obj + form.SelectedZenit) + if ((obj + form.SelectedZenit)==1) { MessageBox.Show("Объект добавлен"); pictureBoxCollection.Image = obj.ShowZenits(); diff --git a/AntiAirCraftGun/AntiAirCraftGun/Generics/SetGeneric.cs b/AntiAirCraftGun/AntiAirCraftGun/Generics/SetGeneric.cs index a9e6890..e63218e 100644 --- a/AntiAirCraftGun/AntiAirCraftGun/Generics/SetGeneric.cs +++ b/AntiAirCraftGun/AntiAirCraftGun/Generics/SetGeneric.cs @@ -38,18 +38,18 @@ namespace AntiAircraftGun.Generics public int Insert(T car) { if (_places.Count == _maxCount) - return false; + return -1; Insert(car, 0); - return true; + return 1; } - public bool Insert(T car, int position) + public int Insert(T car, int position) { if (!(position >= 0 && position <= Count && _places.Count < _maxCount)) - return false; + return -1; _places.Insert(position, car); - return true; + return 1; } ///