PIbd22_Kuznetsov_A.V._Excav.../Excavator/DrawingObjectMash.cs

36 lines
1.2 KiB
C#

using Excavator.MovementStrategy;
using Excavator;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading.Tasks;
using Excavator.DrawingObjects;
namespace Excavator.MovementStrategy
{
public class DrawingObjectMash : IMoveableObject
{
private readonly DrawingMash? _DrawingMash = null;
public DrawingObjectMash(DrawingMash DrawingMash)
{
_DrawingMash = DrawingMash;
}
public ObjectParameters? GetObjectPosition
{
get
{
if (_DrawingMash == null || _DrawingMash.EntityMash == null)
{
return null;
}
return new ObjectParameters(_DrawingMash.GetPosX,_DrawingMash.GetPosY, _DrawingMash.GetWidth, _DrawingMash.GetHeight);
}
}
public int GetStep => (int)(_DrawingMash?.EntityMash?.Step ?? 0);
public bool CheckCanMove(DirectionType direction) => _DrawingMash?.CanMove(direction) ?? false;
public void MoveObject(DirectionType direction) => _DrawingMash?.MoveTransport(direction);
}
}