2023-10-31 12:27:43 +04:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace Catamaran
|
|
|
|
|
{
|
|
|
|
|
public class DrawningObjectCatamaran : IMoveableObject
|
|
|
|
|
{
|
|
|
|
|
private readonly DrawningCatamaran? _DrawningCatamaran = null;
|
2023-11-19 12:36:59 +04:00
|
|
|
|
public DrawningObjectCatamaran(DrawningCatamaran drawningCatamaran)
|
2023-10-31 12:27:43 +04:00
|
|
|
|
{
|
2023-11-19 12:36:59 +04:00
|
|
|
|
_DrawningCatamaran = drawningCatamaran;
|
2023-10-31 12:27:43 +04:00
|
|
|
|
}
|
|
|
|
|
public ObjectParameters? GetObjectPosition
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2023-11-19 12:36:59 +04:00
|
|
|
|
if (_DrawningCatamaran == null || _DrawningCatamaran.EntityCatamaran == null)
|
2023-10-31 12:27:43 +04:00
|
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
return new ObjectParameters(_DrawningCatamaran.GetPosX,
|
|
|
|
|
_DrawningCatamaran.GetPosY, _DrawningCatamaran.GetWidth, _DrawningCatamaran.GetHeight);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public int GetStep => (int)(_DrawningCatamaran?.EntityCatamaran?.Step ?? 0);
|
|
|
|
|
public bool CheckCanMove(DirectionType direction) =>
|
|
|
|
|
_DrawningCatamaran?.CanMove(direction) ?? false;
|
|
|
|
|
public void MoveObject(DirectionType direction) =>
|
|
|
|
|
_DrawningCatamaran?.MoveTransport(direction);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|