From 6f35bd337be03f8162f5078cdd5957d6b971000e Mon Sep 17 00:00:00 2001 From: Danila_Mochalov Date: Fri, 4 Nov 2022 18:37:11 +0400 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=B8=D0=BD=D1=82=D0=B5=D1=80=D1=84=D0=B5=D0=B9?= =?UTF-8?q?=D1=81=D0=B0=20IDrawningObject=20=D0=B8=20=D0=B5=D0=B3=D0=BE=20?= =?UTF-8?q?=D1=80=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7=D0=B0=D1=86=D0=B8=D0=B8=20?= =?UTF-8?q?DrawningObjectLocomotive?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Locomotive/Locomotive/DrawningObjectLocomotive.cs | 4 +++- Locomotive/Locomotive/IDrawningObject.cs | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Locomotive/Locomotive/DrawningObjectLocomotive.cs b/Locomotive/Locomotive/DrawningObjectLocomotive.cs index 4a518dc..ab86474 100644 --- a/Locomotive/Locomotive/DrawningObjectLocomotive.cs +++ b/Locomotive/Locomotive/DrawningObjectLocomotive.cs @@ -26,7 +26,6 @@ namespace Locomotive { return _locomotive?.GetCurrentPosition() ?? default; } - public void MoveObject(Direction direction) { _locomotive?.MoveTransport(direction); @@ -37,5 +36,8 @@ namespace Locomotive _locomotive?.SetPosition(x, y, width, height); } + public string getInfo() => _locomotive?.getDataForSave(); + + public static IDrawningObject Create(string data) => new DrawningObjectLocomotive(data.createDrawningLocomotive()); } } diff --git a/Locomotive/Locomotive/IDrawningObject.cs b/Locomotive/Locomotive/IDrawningObject.cs index 5a7c000..37473dd 100644 --- a/Locomotive/Locomotive/IDrawningObject.cs +++ b/Locomotive/Locomotive/IDrawningObject.cs @@ -19,5 +19,7 @@ namespace Locomotive /// Получение текущей позиции объекта (float Left, float Right, float Top, float Bottom) GetCurrentPosition(); + // Получение информации по объекту + string getInfo(); } }