/
This commit is contained in:
commit
70b6a0b727
@ -76,7 +76,7 @@ public abstract class AbstractCompany
|
||||
public DrawningTrackedVehicle? GetRandomObject()
|
||||
{
|
||||
Random rnd = new();
|
||||
return _collection?.Get(rnd.Next(GetMaxCount));
|
||||
return arr?.Get(rnd.Next(GetMaxCount));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -85,15 +85,19 @@ 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 < (_collection?.Count ?? 0); ++i)
|
||||
for (int i = 0; i < (arr?.Count ?? 0); ++i)
|
||||
{
|
||||
DrawningTrackedVehicle? obj = _collection?.Get(i);
|
||||
try
|
||||
{
|
||||
DrawningTrackedVehicle? obj = arr?.Get(i);
|
||||
obj?.DrawTransport(graphics);
|
||||
}
|
||||
catch (Exception) { }
|
||||
}
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user