labWork_04 #5
@ -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);
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user