42 lines
1.0 KiB
C#
42 lines
1.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Locomotive
|
|
{
|
|
internal class DrawningObjectLocomotive : IDrawningObject
|
|
{
|
|
private DrawningLocomotive _locomotive = null;
|
|
|
|
public DrawningObjectLocomotive(DrawningLocomotive locomotive)
|
|
{
|
|
_locomotive = locomotive;
|
|
}
|
|
|
|
public float Step => _locomotive?.Locomotive?.Step ?? 0;
|
|
|
|
public void DrawningObject(Graphics g)
|
|
{
|
|
_locomotive?.DrawTransport(g);
|
|
}
|
|
|
|
public (float Left, float Right, float Top, float Bottom) GetCurrentPosition()
|
|
{
|
|
return _locomotive?.GetCurrentPosition() ?? default;
|
|
}
|
|
|
|
public void MoveObject(Direction direction)
|
|
{
|
|
_locomotive?.MoveTransport(direction);
|
|
}
|
|
|
|
public void SetObject(int x, int y, int width, int height)
|
|
{
|
|
_locomotive?.SetPosition(x, y, width, height);
|
|
}
|
|
|
|
}
|
|
}
|