From fb4cc240a19c23c1fc6d7ca4efc589d6059815e5 Mon Sep 17 00:00:00 2001 From: gettterot Date: Fri, 15 Mar 2024 09:36:48 +0400 Subject: [PATCH] Adding abstract class --- .../MovementStrategy/IMoveableObjectcs.cs | 10 ++++++++++ .../MovementStrategy/MoveableLiner.cs | 15 ++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/ProjectLiner/ProjectLiner/MovementStrategy/IMoveableObjectcs.cs b/ProjectLiner/ProjectLiner/MovementStrategy/IMoveableObjectcs.cs index a5ace3f..e2b5686 100644 --- a/ProjectLiner/ProjectLiner/MovementStrategy/IMoveableObjectcs.cs +++ b/ProjectLiner/ProjectLiner/MovementStrategy/IMoveableObjectcs.cs @@ -16,6 +16,8 @@ public interface IMoveableObject /// ObjectParameters? GetObjectPosition { get; } + int AnotherStep { set; } + /// /// Шаг объекта /// @@ -27,4 +29,12 @@ public interface IMoveableObject /// Направление /// true - объект перемещен, false - перемещение невозможно bool TryMoveObject(MovementDirection direction); + + + /// + /// ненужный метод + /// + /// Первое число + + void MegaTurboStep(int value); } \ No newline at end of file diff --git a/ProjectLiner/ProjectLiner/MovementStrategy/MoveableLiner.cs b/ProjectLiner/ProjectLiner/MovementStrategy/MoveableLiner.cs index c87517a..b067010 100644 --- a/ProjectLiner/ProjectLiner/MovementStrategy/MoveableLiner.cs +++ b/ProjectLiner/ProjectLiner/MovementStrategy/MoveableLiner.cs @@ -1,4 +1,5 @@ using ProjectLiner.Drawnings; +using ProjectLiner.Entities; using System; using System.Collections.Generic; using System.Linq; @@ -40,13 +41,20 @@ public class MoveableLiner : IMoveableObject public int GetStep => (int)(_CommonLiner?.EntityCommonLiner?.Step ?? 0); + public int AnotherStep + { + set + { + AnotherStep = value; + } + } + public bool TryMoveObject(MovementDirection direction) { if (_CommonLiner == null || _CommonLiner.EntityCommonLiner == null) { return false; } - return _CommonLiner.MoveTransport(GetDirectionType(direction)); } @@ -66,4 +74,9 @@ public class MoveableLiner : IMoveableObject _ => DirectionType.Unknow, }; } + + public void MegaTurboStep(int value) + { + AnotherStep = value; + } } \ No newline at end of file