diff --git a/AirBomber/AirBomber/DrawningBomber.cs b/AirBomber/AirBomber/DrawningBomber.cs index ed8491e..d9f1ee5 100644 --- a/AirBomber/AirBomber/DrawningBomber.cs +++ b/AirBomber/AirBomber/DrawningBomber.cs @@ -130,5 +130,10 @@ namespace AirBomber _startPosY = _pictureHeight.Value - _airBomberHeight; } } + + public (float Left, float Right, float Top, float Bottom) GetCurrentPosition() + { + return (_startPosX, _startPosY, _startPosX + _airBomberWidth, _airBomberHeight); + } } } diff --git a/AirBomber/AirBomber/DrawningObjectBomber.cs b/AirBomber/AirBomber/DrawningObjectBomber.cs new file mode 100644 index 0000000..71d23ba --- /dev/null +++ b/AirBomber/AirBomber/DrawningObjectBomber.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AirBomber +{ + internal class DrawningObjectBomber : IDrawningObject + { + private DrawningBomber _airBomber = null; + + public DrawningObjectBomber(DrawningBomber airBomber) + { + _airBomber = airBomber; + } + + public float Step => _airBomber?.AirBomber?.Step ?? 0; + + public (float Left, float Right, float Top, float Bottom) GetCurrentPosition() + { + return _airBomber?.GetCurrentPosition() ?? default; + } + + public void MoveObject(Direction direction) + { + _airBomber?.MoveTransport(direction); + } + + public void SetObject(int x, int y, int width, int height) + { + _airBomber.SetPosition(x, y, width, height); + } + + public void DrawningObject(Graphics g) + { + + } + } +} diff --git a/AirBomber/AirBomber/IDrawningObject.cs b/AirBomber/AirBomber/IDrawningObject.cs new file mode 100644 index 0000000..02ba166 --- /dev/null +++ b/AirBomber/AirBomber/IDrawningObject.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AirBomber +{ + internal interface IDrawningObject + { + public float Step { get; } + + void SetObject(int x, int y, int width, int height); + + void MoveObject(Direction direction); + + void DrawningObject(Graphics g); + + (float Left, float Right, float Top, float Bottom) GetCurrentPosition(); + } +}