41 lines
1.0 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Battleship
{
internal class DrawningObjectBattleship : IDrawningObject
{
private DrawningBattleship _battleship = null;
public DrawningObjectBattleship(DrawningBattleship battleship)
{
_battleship = battleship;
}
public float Step => _battleship?.Battleship?.Step ?? 0;
public (float Left, float Right, float Top, float Bottom) GetCurrentPosition()
{
return _battleship?.GetCurrentPosition() ?? default;
}
public void MoveObject(Direction direction)
{
_battleship?.MoveTransport(direction);
}
public void SetObject(int x, int y, int width, int height)
{
_battleship.SetPosition(x, y, width, height);
}
void IDrawningObject.DrawningObject(Graphics g)
{
_battleship.DrawTransport(g);
}
}
}