diff --git a/ContainerShip/ContainerShip/DrawingShip.cs b/ContainerShip/ContainerShip/DrawingShip.cs
index 806a413..00b6e4c 100644
--- a/ContainerShip/ContainerShip/DrawingShip.cs
+++ b/ContainerShip/ContainerShip/DrawingShip.cs
@@ -3,13 +3,13 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
-using static ContainerShip.EntityContainerShip;
+using static ContainerShip.EntityShip;
namespace ContainerShip
{
internal class DrawingShip
{
- public EntityContainerShip Ship { private set; get; }
+ public EntityShip Ship { private set; get; }
private float _startPosX;
private float _startPosY;
private int? _pictureWidth = null;
@@ -35,7 +35,7 @@ namespace ContainerShip
/// Цвет кузова
public void Init(int speed, float weight, Color bodyColor)
{
- Ship = new EntityContainerShip();
+ Ship = new EntityShip();
Ship.Init(speed, weight, bodyColor);
}
@@ -47,11 +47,11 @@ namespace ContainerShip
{
// Проверки
Random rn = new Random();
- if (x < 0 || x > width)
+ if (x < 0 || x + _shipWidth> width)
{
x = rn.Next(0, width - _shipWidth);
}
- if (y < 0 || y > height)
+ if (y < 0 || y + _shipHeight > height)
{
y = rn.Next(0, height - _shipHeight);
}
diff --git a/ContainerShip/ContainerShip/EntityContainerShip.cs b/ContainerShip/ContainerShip/EntityShip.cs
similarity index 97%
rename from ContainerShip/ContainerShip/EntityContainerShip.cs
rename to ContainerShip/ContainerShip/EntityShip.cs
index a5dbc3f..15ca4a1 100644
--- a/ContainerShip/ContainerShip/EntityContainerShip.cs
+++ b/ContainerShip/ContainerShip/EntityShip.cs
@@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace ContainerShip
{
- internal class EntityContainerShip
+ internal class EntityShip
{
///
/// Скорость