labWork_04 #5

Merged
gettterot merged 11 commits from labWork_04 into labWork_05 2024-04-17 08:11:23 +04:00
2 changed files with 24 additions and 1 deletions
Showing only changes of commit fb4cc240a1 - Show all commits

View File

@ -16,6 +16,8 @@ public interface IMoveableObject
/// </summary>
ObjectParameters? GetObjectPosition { get; }
int AnotherStep { set; }
/// <summary>
/// Шаг объекта
/// </summary>
@ -27,4 +29,12 @@ public interface IMoveableObject
/// <param name="direction">Направление</param>
/// <returns>true - объект перемещен, false - перемещение невозможно</returns>
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.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;
}
}