From 283b167e758dfe5a150b398ee6bf05f2abfab110 Mon Sep 17 00:00:00 2001 From: RozhVan Date: Tue, 27 Feb 2024 12:01:08 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BB=D0=B0=D0=B1=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ProjectPlane/ProjectPlane/DrawCont.cs | 7 +++++-- ProjectPlane/ProjectPlane/EntityContainer.cs | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ProjectPlane/ProjectPlane/DrawCont.cs b/ProjectPlane/ProjectPlane/DrawCont.cs index 3ca71d7..d26610b 100644 --- a/ProjectPlane/ProjectPlane/DrawCont.cs +++ b/ProjectPlane/ProjectPlane/DrawCont.cs @@ -107,19 +107,22 @@ public class DrawCont return true; case DirectionType.Right: - if (_StartPosX.Value + EntityContainer.Step < _PictureWidth) + if (_StartPosX.Value + EntityContainer.Step < _PictureWidth - _drawingContWidth) { _StartPosX += (int)EntityContainer.Step; } return true; + case DirectionType.Up: + if (_StartPosY.Value - EntityContainer.Step > 0) { _StartPosY -= (int)EntityContainer.Step; } return true; + case DirectionType.Down: - if (_StartPosY.Value + EntityContainer.Step < _PictureHeight) + if (_StartPosY.Value + EntityContainer.Step < _PictureHeight - _drawingContHeight) { _StartPosY += (int)EntityContainer.Step; } diff --git a/ProjectPlane/ProjectPlane/EntityContainer.cs b/ProjectPlane/ProjectPlane/EntityContainer.cs index 4cb381a..5bc1409 100644 --- a/ProjectPlane/ProjectPlane/EntityContainer.cs +++ b/ProjectPlane/ProjectPlane/EntityContainer.cs @@ -34,7 +34,7 @@ public class EntityContainer /// public bool Crane { get; private set; } - public double Step => Speed * 100 / Weight; + public double Step => Speed * 10 / Weight; public void Init(int speed, double weight, Color shipColor, Color containerColor, bool container, bool crane) {