This commit is contained in:
Илья Федотов 2023-12-27 22:55:21 +04:00
parent 977c6de6f6
commit 6d6617ecab
2 changed files with 2 additions and 2 deletions

View File

@ -39,7 +39,7 @@ namespace SelfPropelledArtilleryUnit.Basic
if (obj == null || collect == null)
return false;
return collect?.collection.Insert(obj) ?? false;
return (bool)collect?.collection.Insert(obj, new DrawiningMillitaryUnitEqutables());
}
public static T? operator -(MilitaryGenrericCollection<T, U> collect,
int pos)

View File

@ -28,7 +28,7 @@ namespace SelfPropelledArtilleryUnit.Basic
public bool Insert(T MilitaryUnit, int index, IEqualityComparer<T>? equal = null)
{
if (!(index >= 0 && index <= Count && places.Count < maxCount))
return false;
throw new UnitNotFoundException(index);
if (places.Count == maxCount)
throw new StorageOverflowException(index);
if (equal != null && places.Contains(MilitaryUnit, equal))