diff --git a/WarmlyShip/WarmlyShip/DrawningObjectShip.cs b/WarmlyShip/WarmlyShip/DrawningObjectShip.cs index e7c17d4..ea458d5 100644 --- a/WarmlyShip/WarmlyShip/DrawningObjectShip.cs +++ b/WarmlyShip/WarmlyShip/DrawningObjectShip.cs @@ -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) diff --git a/WarmlyShip/WarmlyShip/EntityWarmlyShip.cs b/WarmlyShip/WarmlyShip/EntityWarmlyShip.cs index 79878fb..40c6473 100644 --- a/WarmlyShip/WarmlyShip/EntityWarmlyShip.cs +++ b/WarmlyShip/WarmlyShip/EntityWarmlyShip.cs @@ -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; } } diff --git a/WarmlyShip/WarmlyShip/FormMapWithSetShip.cs b/WarmlyShip/WarmlyShip/FormMapWithSetShip.cs index b4d69ce..ef6fed7 100644 --- a/WarmlyShip/WarmlyShip/FormMapWithSetShip.cs +++ b/WarmlyShip/WarmlyShip/FormMapWithSetShip.cs @@ -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) {