исправил ошибки
This commit is contained in:
parent
9406327348
commit
7bfa7b0938
@ -67,13 +67,13 @@ namespace ProjectAirplaneWithRadar.Generics
|
||||
private void DrawObjects(Graphics g)
|
||||
{
|
||||
int i = 0;
|
||||
foreach (var monorail in _collection.GetAirplanes())
|
||||
foreach (var airplane in _collection.GetAirplanes())
|
||||
{
|
||||
if (monorail != null)
|
||||
if (airplane != null)
|
||||
{
|
||||
int inRow = _pictureWidth / _placeSizeWidth;
|
||||
monorail.SetPosition(i % inRow * _placeSizeWidth, _pictureHeight - _pictureHeight % _placeSizeHeight - (i / inRow + 1) * _placeSizeHeight);
|
||||
monorail.DrawTransport(g);
|
||||
airplane.SetPosition(i % inRow * _placeSizeWidth, _pictureHeight - _pictureHeight % _placeSizeHeight - (i / inRow + 1) * _placeSizeHeight);
|
||||
airplane.DrawTransport(g);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
@ -40,6 +40,5 @@ namespace ProjectAirplaneWithRadar.Generics
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -53,12 +53,12 @@ namespace ProjectAirplaneWithRadar.Generics
|
||||
return;
|
||||
}
|
||||
}
|
||||
public IEnumerable<T?> GetAirplanes(int? maxMonorails = null)
|
||||
public IEnumerable<T?> GetAirplanes(int? maxAirplanes = null)
|
||||
{
|
||||
for (int i = 0; i < _places.Count; ++i)
|
||||
{
|
||||
yield return _places[i];
|
||||
if (maxMonorails.HasValue && i == maxMonorails.Value)
|
||||
if (maxAirplanes.HasValue && i == maxAirplanes.Value)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user