Youdakova D.R. PIbd-21 LabWork05 #5
@ -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)
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -47,6 +47,5 @@ namespace AircraftCarrier
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user