Adding abstract class

This commit is contained in:
gettterot 2024-03-15 09:36:48 +04:00
parent f1f6698e1f
commit fb4cc240a1
2 changed files with 24 additions and 1 deletions

View File

@ -16,6 +16,8 @@ public interface IMoveableObject
/// </summary> /// </summary>
ObjectParameters? GetObjectPosition { get; } ObjectParameters? GetObjectPosition { get; }
int AnotherStep { set; }
/// <summary> /// <summary>
/// Шаг объекта /// Шаг объекта
/// </summary> /// </summary>
@ -27,4 +29,12 @@ public interface IMoveableObject
/// <param name="direction">Направление</param> /// <param name="direction">Направление</param>
/// <returns>true - объект перемещен, false - перемещение невозможно</returns> /// <returns>true - объект перемещен, false - перемещение невозможно</returns>
bool TryMoveObject(MovementDirection direction); bool TryMoveObject(MovementDirection direction);
/// <summary>
/// ненужный метод
/// </summary>
/// <param name="value">Первое число</param>
void MegaTurboStep(int value);
} }

View File

@ -1,4 +1,5 @@
using ProjectLiner.Drawnings; using ProjectLiner.Drawnings;
using ProjectLiner.Entities;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@ -40,13 +41,20 @@ public class MoveableLiner : IMoveableObject
public int GetStep => (int)(_CommonLiner?.EntityCommonLiner?.Step ?? 0); public int GetStep => (int)(_CommonLiner?.EntityCommonLiner?.Step ?? 0);
public int AnotherStep
{
set
{
AnotherStep = value;
}
}
public bool TryMoveObject(MovementDirection direction) public bool TryMoveObject(MovementDirection direction)
{ {
if (_CommonLiner == null || _CommonLiner.EntityCommonLiner == null) if (_CommonLiner == null || _CommonLiner.EntityCommonLiner == null)
{ {
return false; return false;
} }
return _CommonLiner.MoveTransport(GetDirectionType(direction)); return _CommonLiner.MoveTransport(GetDirectionType(direction));
} }
@ -66,4 +74,9 @@ public class MoveableLiner : IMoveableObject
_ => DirectionType.Unknow, _ => DirectionType.Unknow,
}; };
} }
public void MegaTurboStep(int value)
{
AnotherStep = value;
}
} }