PIbd-14 Pruidze_I.K. LabWork08 Simple #15
@ -60,8 +60,16 @@ public abstract class AbstractCompany
|
||||
|
||||
for (int i = 0; i < (_collection?.Count ?? 0); i++)
|
||||
{
|
||||
DrawningBase? obj = _collection?.GetItem(i);
|
||||
obj?.DrawTransport(graphics);
|
||||
// try
|
||||
// {
|
||||
|
||||
DrawningBase? obj = _collection?.GetItem(i);
|
||||
obj?.DrawTransport(graphics);
|
||||
|
||||
// } catch (Exception ex)
|
||||
// {
|
||||
// Console.WriteLine(ex.Message);
|
||||
// }
|
||||
}
|
||||
|
||||
return bitmap;
|
||||
|
@ -53,12 +53,17 @@ public class ShipSharingService : AbstractCompany
|
||||
int newX = fromBorder + 2;
|
||||
for (int j = 0; j < MaxInRow; j++)
|
||||
{
|
||||
// TRY / CATCH [?]
|
||||
_collection.GetItem(index_collection).SetPictureSize(
|
||||
_pictureWidth, _pictureHeight);
|
||||
try
|
||||
{
|
||||
_collection.GetItem(index_collection).SetPictureSize(
|
||||
_pictureWidth, _pictureHeight);
|
||||
|
||||
_collection.GetItem(index_collection).SetPosition(newX, newY);
|
||||
_collection.GetItem(index_collection).SetPosition(newX, newY);
|
||||
|
||||
} catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex.ToString());
|
||||
}
|
||||
newX += _placeSizeWidth + between + 2;
|
||||
|
||||
if (index_collection < border)
|
||||
|
@ -7,12 +7,12 @@ public class DrawningShipCompare : IComparer<DrawningBase?>
|
||||
{
|
||||
if (x == null || x.EntityTransport == null)
|
||||
{
|
||||
return -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (y == null || y.EntityTransport == null)
|
||||
{
|
||||
return 1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (x.GetType().Name != y.GetType().Name)
|
||||
|
Loading…
Reference in New Issue
Block a user