51 lines
1.2 KiB
C#
51 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Airbus
|
|
{
|
|
internal class DrawningObjectPlane : IDrawningObject
|
|
{
|
|
private DrawningAirbus _airbus;
|
|
|
|
public float Step => _airbus?.Airbus?.Step ?? 0;
|
|
|
|
public DrawningObjectPlane(DrawningAirbus airbus)
|
|
{
|
|
_airbus = airbus;
|
|
}
|
|
|
|
void IDrawningObject.DrawningObject(Graphics g)
|
|
{
|
|
_airbus.DrawTransport(g);
|
|
}
|
|
|
|
public (float Left, float Right, float Top, float Bottom) GetCurrentPosition()
|
|
{
|
|
return _airbus?.GetCurrentPosition() ?? default;
|
|
}
|
|
|
|
public void MoveObject(Direction direction)
|
|
{
|
|
_airbus?.MoveTransport(direction);
|
|
}
|
|
|
|
public void SetObject(int x, int y, int width, int height)
|
|
{
|
|
_airbus?.SetPosition(x, y, width, height);
|
|
}
|
|
|
|
public void DrawningObject()
|
|
{
|
|
//TODO
|
|
}
|
|
|
|
public string GetInfo() => _airbus?.GetDataForSave();
|
|
|
|
public static IDrawningObject Create(string data) => new DrawningObjectPlane(data.CreateDrawningPlane());
|
|
|
|
}
|
|
}
|