Aleikin A.M. LabWork02 #2

Merged
eegov merged 9 commits from LabWork02 into LabWork01 2022-10-28 09:12:52 +04:00
3 changed files with 66 additions and 0 deletions
Showing only changes of commit b83531e445 - Show all commits

View File

@ -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);
}
}
}

View File

@ -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)
{
}
}
}

View File

@ -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();
}
}