Tomasheva_Lab_№7 #8
@ -49,7 +49,7 @@
|
||||
{
|
||||
int width = picWidth / _placeSizeWidth;
|
||||
int height = picHeight / _placeSizeHeight;
|
||||
_setRoadTrains = new SetRoadTrainsGeneric<T>(width * height - 2);
|
||||
_setRoadTrains = new SetRoadTrainsGeneric<T>(width * height - 1);
|
||||
_pictureWidth = picWidth;
|
||||
_pictureHeight = picHeight;
|
||||
_map = map;
|
||||
|
@ -27,6 +27,7 @@
|
||||
<PackageReference Include="Serilog" Version="2.12.0" />
|
||||
<PackageReference Include="Serilog.Extensions.Logging" Version="3.1.0" />
|
||||
<PackageReference Include="Serilog.Settings.Configuration" Version="3.4.0" />
|
||||
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -72,9 +72,13 @@
|
||||
public T Remove(int position)
|
||||
{
|
||||
// проверка позиции
|
||||
if (position < 0 || position >= _maxCount)
|
||||
if (position < 0 || position >= _maxCount - 1)
|
||||
return null;
|
||||
T delObj = _places[position];
|
||||
if (position >= _places.Count)
|
||||
{
|
||||
throw new RoadTrainNotFoundException(position);
|
||||
}
|
||||
var delObj = _places[position];
|
||||
if (delObj == null)
|
||||
{
|
||||
throw new RoadTrainNotFoundException(position);
|
||||
|
Loading…
Reference in New Issue
Block a user