From 4a3fdebbdf55fc53b6ff3893f6ed984b97a97ef7 Mon Sep 17 00:00:00 2001
From: ksenianeva <95441235+ksenianeva@users.noreply.github.com>
Date: Mon, 3 Oct 2022 21:50:34 +0400
Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B2=D0=B0=D1=8F=20=D0=BB?=
=?UTF-8?q?=D0=B0=D0=B1=D0=BE=D1=80=D0=B0=D1=82=D0=BE=D1=80=D0=BD=D0=B0?=
=?UTF-8?q?=D1=8F=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0.=20=D0=98=D1=81?=
=?UTF-8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B0=20=D0=BF=D1=80?=
=?UTF-8?q?=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D0=B0=20SetPosition,=20=D0=BD?=
=?UTF-8?q?=D0=B0=D0=B7=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=BA=D0=BB=D0=B0?=
=?UTF-8?q?=D1=81=D1=81=D0=B0.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
ContainerShip/ContainerShip/DrawingShip.cs | 10 +++++-----
.../{EntityContainerShip.cs => EntityShip.cs} | 2 +-
2 files changed, 6 insertions(+), 6 deletions(-)
rename ContainerShip/ContainerShip/{EntityContainerShip.cs => EntityShip.cs} (97%)
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
{
///
/// Скорость