Morozov V.S. LabWork2 #2

Merged
eegov merged 4 commits from LabWork2 into LabWork1 2022-10-07 09:32:18 +04:00
3 changed files with 63 additions and 0 deletions
Showing only changes of commit 82c8174312 - Show all commits

View File

@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AirPlaneWithRadar
{
internal class DrawingObject : IDrawingObject
{
private DrawingPlain _plain;
public DrawingObject(DrawingPlain plain)
{
_plain = plain;
}
public float Step => _plain?.Plain?.Step ?? 0;
public void DrawningObject(Graphics g)
{
//TODO
Review

Код по заданию отсутствует

Код по заданию отсутствует
}
public (float Left, float Right, float Top, float Bottom) GetCurrentPosition()
{
return _plain?.GetCurrentPosition() ?? default;
}
public void MoveObject(Direction direction)
{
_plain?.MoveTransport(direction);
}
public void SetObject(int x, int y, int width, int height)
{
_plain.setPosition(x, y, width, height);
}
}
}

View File

@ -121,5 +121,9 @@ namespace AirPlaneWithRadar
if(startPosY + plainHeight > pictureHeight)
startPosY = pictureHeight.Value - plainHeight;
}
public (float Left, float Right, float Top, float Bottom) GetCurrentPosition()
{
return (startPosX, startPosY, startPosX + plainWidth, startPosY + plainHeight);
}
}
}

View File

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AirPlaneWithRadar
{
internal interface IDrawingObject
{
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();
}
}