Compare commits

...

2 Commits

Author SHA1 Message Date
beb7bdf552 Слетевшая 7 лаба готова 2024-05-20 04:55:35 +03:00
72081a1e24 Сохраниние хоть чего-то 2024-05-08 20:05:33 +03:00
4 changed files with 24 additions and 12 deletions

View File

@ -11,8 +11,12 @@
<ItemGroup>
<PackageReference Include="EntityFramework" Version="6.2.0" />
<PackageReference Include="EntityFramework.ru" Version="6.2.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Serilog" Version="3.1.1" />
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="8.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
</ItemGroup>
</Project>

View File

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

View File

@ -45,19 +45,22 @@ public class GunSharingService : AbstractCompany
int boarderOffsetY = 10;
int currentIndex = -1;
for (int j = 0; j < maxCountY; j++)
try
{
for (int i = 0; i < maxCountX; i++)
for (int j = 0; j < maxCountY; j++)
{
currentIndex++;
if (_collection.Get(currentIndex) != null)
for (int i = 0; i < maxCountX; i++)
{
currentIndex++;
if (_collection.Get(currentIndex) != null)
{
_collection.Get(currentIndex).SetPictureSize(_pictureWidth, _pictureHeight);
_collection.Get(currentIndex).SetPosition(boarderOffsetX + i * _placeSizeWidth + i * offsetX, boarderOffsetY + j * _placeSizeHeight);
_collection.Get(currentIndex).SetPictureSize(_pictureWidth, _pictureHeight);
_collection.Get(currentIndex).SetPosition(boarderOffsetX + i * _placeSizeWidth + i * offsetX, boarderOffsetY + j * _placeSizeHeight);
}
}
}
}
}catch (Exception ) { }
}
}

View File

@ -1,5 +1,7 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Serilog;
namespace AntiAircraftGun
{