Убрал закомментированные фрагменты кода

This commit is contained in:
Никита Шипилов 2024-04-29 06:21:27 +04:00
parent 5414ff55a1
commit 915c8cea9c
2 changed files with 8 additions and 4 deletions

View File

@ -49,8 +49,12 @@ public abstract class AbstractCompany
SetObjectsPosition(); SetObjectsPosition();
for (int i = 0; i < (_collection?.Count ?? 0); ++i) for (int i = 0; i < (_collection?.Count ?? 0); ++i)
{ {
DrawingPlane? obj = _collection?.Get(i); try
obj?.DrawTransport(graphics); {
DrawingPlane? obj = _collection?.Get(i);
obj?.DrawTransport(graphics);
}
catch (Exception) { }
} }
return bitmap; return bitmap;

View File

@ -38,10 +38,10 @@ public class MassiveGenericObjects<T> : ICollectionGenericObjects<T>
_collection = Array.Empty<T?>(); _collection = Array.Empty<T?>();
} }
public T Get(int position) public T? Get(int position)
{ {
if (position >= _collection.Length || position < 0) throw new PositionOutOfCollectionException(position); if (position >= _collection.Length || position < 0) throw new PositionOutOfCollectionException(position);
//if (_collection[position] == null) throw new ObjectNotFoundException(position); if (_collection[position] == null) throw new ObjectNotFoundException(position);
return _collection[position]; return _collection[position];
} }