Lab7 fix
This commit is contained in:
parent
cebb91a24c
commit
5f39e71615
@ -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