50 lines
1.3 KiB
C#
50 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using static System.Windows.Forms.AxHost;
|
|
|
|
namespace Trolleybus
|
|
{
|
|
internal class DrawningObject : IDrawningObject
|
|
{
|
|
private DrawingTrolleybus _trolleybus = null;
|
|
|
|
public DrawningObject(DrawingTrolleybus car)
|
|
{
|
|
_trolleybus = car;
|
|
}
|
|
|
|
public float Step => _trolleybus?.Trolleybus?.Step ?? 0;
|
|
|
|
public (float Left, float Right, float Top, float Bottom) GetCurrentPosition()
|
|
{
|
|
return _trolleybus?.GetCurrentPosition() ?? default;
|
|
}
|
|
|
|
public void MoveObject(Direction direction)
|
|
{
|
|
_trolleybus?.MoveTransport(direction);
|
|
}
|
|
|
|
public void nothing()
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public void SetObject(int x, int y, int width, int height)
|
|
{
|
|
_trolleybus.SetPosition(x, y, width, height);
|
|
}
|
|
|
|
void IDrawningObject.DrawningObject(Graphics g)
|
|
{
|
|
_trolleybus.DrawTransport(g);
|
|
}
|
|
public string GetInfo() => _trolleybus?.GetDataForSave();
|
|
public static IDrawningObject Create(string data) => new DrawningObjectTrolleybus(data.CreateDrawingTrolleybus());
|
|
}
|
|
}
|