Lisov N.A. Lab_work2 #2

Merged
eegov merged 11 commits from LabWork02 into LabWork01 2022-09-30 09:43:17 +04:00
3 changed files with 68 additions and 0 deletions
Showing only changes of commit 88725c4703 - Show all commits

View File

@ -241,5 +241,10 @@ namespace AirFighter
}
}
public (float Left, float Right, float Top, float Bottom) GetCurrentPosition()
{
return (_startPosX, _startPosY, _startPosX + _aircraftWidth, _startPosY + _aircraftHeight);
}
}
}

View File

@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AirFighter
{
internal class DrawingObjectAircraft : IDrawingObject
{
private DrawingAircraft _aircraft = null;
public DrawingObjectAircraft(DrawingAircraft aircraft)
{
_aircraft = aircraft;
}
public float Step => _aircraft.Plane?.Step ?? 0;
public (float Left, float Right, float Top, float Bottom) GetCurrentPosition()
{
return _aircraft?.GetCurrentPosition() ?? default;
}
public void MoveObject(Direction direction)
{
_aircraft.MoveTransport(direction);
}
public void SetObject(int x, int y, int width, int height)
{
_aircraft.SetPosition(x, y, width, height);
}
void IDrawingObject.DrawingObject(Graphics g)
{
_aircraft.DrawTransport(g);
}
}
Review

Дополнительное задание в итоговый код не включается

Дополнительное задание в итоговый код не включается
}

View File

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AirFighter
{
internal interface IDrawingObject
{
public float Step { get; }
void SetObject(int x, int y, int width, int height);
void MoveObject(Direction direction);
void DrawingObject(Graphics g);
(float Left, float Right, float Top, float Bottom) GetCurrentPosition();
Review

Дополнительное задание в итоговый код не включается

Дополнительное задание в итоговый код не включается
}
}