Markov D.P. LabWork03 #6

Merged
eegov merged 6 commits from LabWork03 into LabWork02 2022-11-07 10:30:45 +04:00
3 changed files with 38 additions and 8 deletions
Showing only changes of commit 86b8d7bac7 - Show all commits

View File

@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
</Project>

View File

@ -8,6 +8,10 @@
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<None Include="ContainerShip.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>

View File

@ -33,9 +33,9 @@ namespace ContainerShip
_map = map;
}
public static int operator +(MapWithSetShipGeneric<T, U> map, T car)
public static int operator +(MapWithSetShipGeneric<T, U> map, T ship)
{
return map._setShip.Insert(car);
return map._setShip.Insert(ship);
}
public static T operator -(MapWithSetShipGeneric<T, U> map, int
@ -58,10 +58,10 @@ namespace ContainerShip
Shaking();
for (int i = 0; i < _setShip.Count; i++)
{
var car = _setShip.Get(i);
if (car != null)
var ship = _setShip.Get(i);
if (ship != null)
{
return _map.CreateMap(_pictureWidth, _pictureHeight, car);
return _map.CreateMap(_pictureWidth, _pictureHeight, ship);
}
}
return new(_pictureWidth, _pictureHeight);
@ -85,10 +85,10 @@ namespace ContainerShip
{
for (; j > i; j--)
{
var car = _setShip.Get(j);
if (car != null)
var ship = _setShip.Get(j);
if (ship != null)
{
_setShip.Insert(car, i);
_setShip.Insert(ship, i);
_setShip.Remove(j);
break;
}