Youdakova D.R. PIbd-21 LabWork05 #5

Closed
Daniya_Youdakova wants to merge 5 commits from LabWork05 into LabWork04
3 changed files with 9 additions and 7 deletions
Showing only changes of commit a72f35472d - Show all commits

View File

@ -148,7 +148,7 @@ namespace AircraftCarrier
for (int i = 0; i < _pictureWidth / _placeSizeWidth; i++)
{
for (int j = 0; j < _pictureHeight / _placeSizeHeight + 1; ++j)
{//линия разметки места
{//линия рамзетки места
g.DrawLine(pen, i * _placeSizeWidth, j * _placeSizeHeight, i *
_placeSizeWidth + _placeSizeWidth / 2, j * _placeSizeHeight);
}
@ -164,8 +164,10 @@ namespace AircraftCarrier
{
int yNumOfPlaces = _pictureHeight / _placeSizeHeight;
int xNumOfPlaces = _pictureWidth / _placeSizeWidth;
int rowNum = yNumOfPlaces - 1;
int columnNum = 0;
for (int i = 0; i < _setAircraftCarriers.Count; i++)
{
if (_setAircraftCarriers[i] != null)

View File

@ -75,6 +75,7 @@ namespace AircraftCarrier
/// </summary>
/// <param name="position"></param>
/// <returns></returns>
public T this[int position]
{
get
@ -85,15 +86,14 @@ namespace AircraftCarrier
{
Insert(value, position);
}
}
public IEnumerable<T> GetAircraftCarriers()
public IEnumerable<T> GetCars()
{
foreach (var aircraftcarrier in _places)
foreach (var car in _places)
{
if (aircraftcarrier != null)
if (car != null)
{
yield return aircraftcarrier;
yield return car;
}
else
{
@ -101,5 +101,6 @@ namespace AircraftCarrier
}
}
}
}
}

View File

@ -47,6 +47,5 @@ namespace AircraftCarrier
}
}
}
}
}