36 lines
916 B
C#
36 lines
916 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace DoubleDeckerBus
|
|
{
|
|
class DrawningObjectBus : IDrawningObject
|
|
{
|
|
private DrawningBus _bus = null;
|
|
public DrawningObjectBus(DrawningBus bus)
|
|
{
|
|
_bus = bus;
|
|
}
|
|
public float Step => _bus?.Bus?.Step ?? 0;
|
|
public (float Left, float Right, float Top, float Bottom) GetCurrentPosition()
|
|
{
|
|
return _bus?.GetCurrentPosition() ?? default;
|
|
}
|
|
public void MoveObject(Direction direction)
|
|
{
|
|
_bus?.MoveTransport(direction);
|
|
}
|
|
public void SetObject(int x, int y, int width, int height)
|
|
{
|
|
_bus.SetPosition(x, y, width, height);
|
|
}
|
|
public void DrawningObject(Graphics g)
|
|
{
|
|
_bus.DrawTransport(g);
|
|
}
|
|
|
|
}
|
|
}
|