исправил нерабочий кал
This commit is contained in:
parent
7932eac791
commit
1210667283
@ -69,6 +69,12 @@ namespace WarmlyShip
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((ship is EntityMotorShip) && !(otherShipShip is EntityMotorShip)
|
||||
|| !(ship is EntityMotorShip) && (otherShipShip is EntityMotorShip))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ship is EntityMotorShip motorShip && otherShipShip is EntityMotorShip otherMotorShip)
|
||||
{
|
||||
if (motorShip.DopColor != otherMotorShip.DopColor)
|
||||
|
@ -17,8 +17,8 @@ namespace WarmlyShip
|
||||
public EntityWarmlyShip(int speed, float weight, Color bodyColor)
|
||||
{
|
||||
Random random = new Random();
|
||||
Speed = speed <= 0 ? random.Next(100, 300) : speed;
|
||||
Weight = weight <= 0 ? random.Next(1000, 2000) : weight;
|
||||
Speed = speed <= 0 ? 100 : speed;
|
||||
Weight = weight <= 0 ? 1000 : weight;
|
||||
BodyColor = bodyColor;
|
||||
}
|
||||
}
|
||||
|
@ -113,6 +113,7 @@ namespace WarmlyShip
|
||||
pictureBox.Image = _mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].ShowSet();
|
||||
_logger.LogInformation($"Добавлен объект: {ship} на карте: {listBoxMaps.SelectedItem}");
|
||||
}
|
||||
else MessageBox.Show("Объект не добавлен");
|
||||
}
|
||||
catch (StorageOverflowException ex)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user