Compare commits

..

No commits in common. "70b6a0b7271beabc8d123cd10e2355d9acb7f447" and "155f7c3297bc8ff2e9e85cce1554dc3155ce2f93" have entirely different histories.

View File

@ -76,7 +76,7 @@ public abstract class AbstractCompany
public DrawningTrackedVehicle? GetRandomObject()
{
Random rnd = new();
return arr?.Get(rnd.Next(GetMaxCount));
return _collection?.Get(rnd.Next(GetMaxCount));
}
/// <summary>
@ -85,18 +85,14 @@ public abstract class AbstractCompany
/// <returns></returns>
public Bitmap? Show()
{
Bitmap bitmap = new(pictureWidth, pictureHeight);
Bitmap bitmap = new(_pictureWidth, _pictureHeight);
Graphics graphics = Graphics.FromImage(bitmap);
DrawBackgound(graphics);
SetObjectsPosition();
for (int i = 0; i < (arr?.Count ?? 0); ++i)
for (int i = 0; i < (_collection?.Count ?? 0); ++i)
{
try
{
DrawningTrackedVehicle? obj = arr?.Get(i);
obj?.DrawTransport(graphics);
}
catch (Exception) { }
DrawningTrackedVehicle? obj = _collection?.Get(i);
obj?.DrawTransport(graphics);
}
return bitmap;
}