Compare commits
No commits in common. "63b5bc994b625596bff5e7f4596d95e45165096f" and "393b97f07178fc1219b866b08c8ac1316fcf66b6" have entirely different histories.
63b5bc994b
...
393b97f071
@ -7,41 +7,87 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace AirBomber
|
namespace AirBomber
|
||||||
{
|
{
|
||||||
public class DrawningAirBomber : DrawningAirPlane
|
public class DrawningAirBomber
|
||||||
{
|
{
|
||||||
/// <summary>
|
public EntityAirBomber? EntityAirBomber { get; private set; }
|
||||||
/// Конструктор
|
private int _pictureWidth;
|
||||||
/// </summary>
|
private int _pictureHeight;
|
||||||
/// <param name="speed">Скорость</param>
|
private int _startPosX;
|
||||||
/// <param name="weight">Вес</param>
|
private int _startPosY;
|
||||||
/// <param name="bodyColor">Основной цвет</param>
|
private readonly int _bomberWidth = 160;
|
||||||
/// <param name="additionalColor">Дополнительный цвет</param>
|
private readonly int _bomberHeight = 118;
|
||||||
/// <param name="bodyKit">Признак наличия обвеса</param>
|
public bool Init(int speed, double weight, Color bodyColor, Color additionalColor, bool bombs, Color bombsColor, bool fuelTanks, int width, int height)
|
||||||
/// <param name="wing">Признак наличия антикрыла</param>
|
|
||||||
/// <param name="sportLine">Признак наличия гоночной полосы</param>
|
|
||||||
/// <param name="width">Ширина картинки</param>
|
|
||||||
/// <param name="height">Высота картинки</param>
|
|
||||||
public DrawningAirBomber(int speed, double weight, Color bodyColor, Color
|
|
||||||
additionalColor, bool bombs, Color bombsColor, bool fuelTanks, int width, int height) :
|
|
||||||
|
|
||||||
base(speed, weight, bodyColor, width, height, 110, 60)
|
|
||||||
{
|
{
|
||||||
if (EntityAirPlane != null)
|
_pictureWidth = width;
|
||||||
|
_pictureHeight = height;
|
||||||
|
if (width < _bomberWidth || height < _bomberHeight)
|
||||||
{
|
{
|
||||||
EntityAirPlane = new EntityAirBomber(speed, weight, bodyColor, additionalColor, bombs, fuelTanks);
|
return false;
|
||||||
|
}
|
||||||
|
EntityAirBomber = new EntityAirBomber();
|
||||||
|
EntityAirBomber.Init(speed, weight, bodyColor, additionalColor, bombs, bombsColor, fuelTanks);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
public void SetPosition(int x, int y)
|
||||||
|
{
|
||||||
|
if (x < 0 || x + _bomberWidth > _pictureWidth)
|
||||||
|
{
|
||||||
|
x = _pictureWidth - _bomberWidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (y < 0 || y + _bomberWidth > _pictureHeight)
|
||||||
|
{
|
||||||
|
y = _pictureHeight - _bomberHeight;
|
||||||
|
}
|
||||||
|
_startPosX = x;
|
||||||
|
_startPosY = y;
|
||||||
|
}
|
||||||
|
public void MoveTransport(DirectionType direction)
|
||||||
|
{
|
||||||
|
if (EntityAirBomber == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
switch (direction)
|
||||||
|
{
|
||||||
|
case DirectionType.Left:
|
||||||
|
if (_startPosX - EntityAirBomber.Step > 0)
|
||||||
|
{
|
||||||
|
_startPosX -= (int)EntityAirBomber.Step;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case DirectionType.Up:
|
||||||
|
if (_startPosY - EntityAirBomber.Step > 0)
|
||||||
|
{
|
||||||
|
_startPosY -= (int)EntityAirBomber.Step;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case DirectionType.Right:
|
||||||
|
if (_startPosX + EntityAirBomber.Step + _bomberWidth < _pictureWidth)
|
||||||
|
{
|
||||||
|
_startPosX += (int)EntityAirBomber.Step;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case DirectionType.Down:
|
||||||
|
if (_startPosY + EntityAirBomber.Step + _bomberHeight < _pictureHeight)
|
||||||
|
{
|
||||||
|
_startPosY += (int)EntityAirBomber.Step;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public override void DrawPlane(Graphics g)
|
public void DrawBomber(Graphics g)
|
||||||
{
|
{
|
||||||
if (EntityAirPlane is not EntityAirPlane airBomber)
|
if (EntityAirBomber == null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Pen pen = new(Color.Black);
|
Pen pen = new(Color.Black);
|
||||||
Brush additionalBrush = new SolidBrush(airBomber.AdditionalColor);
|
Brush additionalBrush = new SolidBrush(EntityAirBomber.AdditionalColor);
|
||||||
base.DrawPlane(g);
|
Brush bodyColor = new SolidBrush(EntityAirBomber.BodyColor);
|
||||||
// обвесы
|
Brush bombsColor = new SolidBrush(EntityAirBomber.BombsColor);
|
||||||
if (airBomber.Bombs)
|
Brush wingsColor = new SolidBrush(Color.DeepPink);
|
||||||
|
if (EntityAirBomber.Bombs)
|
||||||
{
|
{
|
||||||
g.FillEllipse(bombsColor, _startPosX + 90, _startPosY + 20, 15, 29);
|
g.FillEllipse(bombsColor, _startPosX + 90, _startPosY + 20, 15, 29);
|
||||||
g.DrawEllipse(pen, _startPosX + 90, _startPosY + 20, 15, 29);
|
g.DrawEllipse(pen, _startPosX + 90, _startPosY + 20, 15, 29);
|
||||||
@ -49,9 +95,90 @@ namespace AirBomber
|
|||||||
g.DrawEllipse(pen, _startPosX + 90, _startPosY + 70, 15, 29);
|
g.DrawEllipse(pen, _startPosX + 90, _startPosY + 70, 15, 29);
|
||||||
g.FillEllipse(bombsColor, _startPosX + 140, _startPosY + 50, 15, 15);
|
g.FillEllipse(bombsColor, _startPosX + 140, _startPosY + 50, 15, 15);
|
||||||
g.DrawEllipse(pen, _startPosX + 140, _startPosY + 50, 15, 15);
|
g.DrawEllipse(pen, _startPosX + 140, _startPosY + 50, 15, 15);
|
||||||
|
|
||||||
}
|
}
|
||||||
// fueltanks
|
g.FillPolygon(additionalBrush, new Point[] //nose
|
||||||
if (airBomber.FuelTanks)
|
{
|
||||||
|
new Point(_startPosX + 19, _startPosY + 50),
|
||||||
|
new Point(_startPosX + 19, _startPosY + 69),
|
||||||
|
new Point(_startPosX + 1, _startPosY + 59),
|
||||||
|
}
|
||||||
|
);
|
||||||
|
g.FillRectangle(bodyColor, _startPosX + 20, _startPosY + 50, 120, 20); //body
|
||||||
|
g.FillPolygon(additionalBrush, new Point[] //up left wing
|
||||||
|
{
|
||||||
|
new Point(_startPosX + 36, _startPosY + 49),
|
||||||
|
new Point(_startPosX + 36, _startPosY + 1),
|
||||||
|
new Point(_startPosX + 45, _startPosY + 1),
|
||||||
|
new Point(_startPosX + 55, _startPosY + 49),
|
||||||
|
}
|
||||||
|
);
|
||||||
|
g.FillPolygon(additionalBrush, new Point[] //down left wing
|
||||||
|
{
|
||||||
|
new Point(_startPosX + 36, _startPosY + 71),
|
||||||
|
new Point(_startPosX + 36, _startPosY + 116),
|
||||||
|
new Point(_startPosX + 45, _startPosY + 116),
|
||||||
|
new Point(_startPosX + 54, _startPosY + 71),
|
||||||
|
}
|
||||||
|
);
|
||||||
|
g.FillPolygon(wingsColor, new Point[] //up right wing
|
||||||
|
{
|
||||||
|
new Point(_startPosX + 120, _startPosY + 49),
|
||||||
|
new Point(_startPosX + 120, _startPosY + 42),
|
||||||
|
new Point(_startPosX + 140, _startPosY + 7),
|
||||||
|
new Point(_startPosX + 140, _startPosY + 49),
|
||||||
|
}
|
||||||
|
);
|
||||||
|
g.FillPolygon(wingsColor, new Point[] //down right wing
|
||||||
|
{
|
||||||
|
new Point(_startPosX + 120, _startPosY + 70),
|
||||||
|
new Point(_startPosX + 120, _startPosY + 77),
|
||||||
|
new Point(_startPosX + 140, _startPosY + 112),
|
||||||
|
new Point(_startPosX + 140, _startPosY + 70),
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
g.DrawPolygon(pen, new Point[] //nose
|
||||||
|
{
|
||||||
|
new Point(_startPosX + 20, _startPosY + 49),
|
||||||
|
new Point(_startPosX + 20, _startPosY + 70),
|
||||||
|
new Point(_startPosX, _startPosY + 59),
|
||||||
|
}
|
||||||
|
);
|
||||||
|
g.DrawRectangle(pen, _startPosX + 19, _startPosY + 49, 121, 21); //body
|
||||||
|
g.DrawPolygon(pen, new Point[] //up left wing
|
||||||
|
{
|
||||||
|
new Point(_startPosX + 35, _startPosY + 49),
|
||||||
|
new Point(_startPosX + 35, _startPosY),
|
||||||
|
new Point(_startPosX + 45, _startPosY),
|
||||||
|
new Point(_startPosX + 55, _startPosY + 49),
|
||||||
|
}
|
||||||
|
);
|
||||||
|
g.DrawPolygon(pen, new Point[] //down left wing
|
||||||
|
{
|
||||||
|
new Point(_startPosX + 36, _startPosY + 71),
|
||||||
|
new Point(_startPosX + 36, _startPosY + 116),
|
||||||
|
new Point(_startPosX + 45, _startPosY + 116),
|
||||||
|
new Point(_startPosX + 54, _startPosY + 71),
|
||||||
|
}
|
||||||
|
);
|
||||||
|
g.DrawPolygon(pen, new Point[] //up right wing
|
||||||
|
{
|
||||||
|
new Point(_startPosX + 120, _startPosY + 49),
|
||||||
|
new Point(_startPosX + 120, _startPosY + 42),
|
||||||
|
new Point(_startPosX + 140, _startPosY + 7),
|
||||||
|
new Point(_startPosX + 140, _startPosY + 49),
|
||||||
|
}
|
||||||
|
);
|
||||||
|
g.DrawPolygon(pen, new Point[] //down right wing
|
||||||
|
{
|
||||||
|
new Point(_startPosX + 120, _startPosY + 70),
|
||||||
|
new Point(_startPosX + 120, _startPosY + 77),
|
||||||
|
new Point(_startPosX + 140, _startPosY + 112),
|
||||||
|
new Point(_startPosX + 140, _startPosY + 70),
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (EntityAirBomber.FuelTanks)
|
||||||
{
|
{
|
||||||
g.FillRectangle(additionalBrush, _startPosX + 63, _startPosY + 34, 20, 15);
|
g.FillRectangle(additionalBrush, _startPosX + 63, _startPosY + 34, 20, 15);
|
||||||
g.DrawRectangle(pen, _startPosX + 63, _startPosY + 34, 20, 15);
|
g.DrawRectangle(pen, _startPosX + 63, _startPosY + 34, 20, 15);
|
||||||
|
@ -1,219 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace AirBomber
|
|
||||||
{
|
|
||||||
public class DrawningAirPlane
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Класс-сущность
|
|
||||||
/// </summary>
|
|
||||||
public EntityAirPlane? EntityAirPlane { get; protected set; }
|
|
||||||
/// <summary>
|
|
||||||
/// Ширина окна
|
|
||||||
/// </summary>
|
|
||||||
private int _pictureWidth;
|
|
||||||
/// <summary>
|
|
||||||
/// Высота окна
|
|
||||||
/// </summary>
|
|
||||||
private int _pictureHeight;
|
|
||||||
/// <summary>
|
|
||||||
/// Левая координата прорисовки самолета
|
|
||||||
/// </summary>
|
|
||||||
protected int _startPosX;
|
|
||||||
/// <summary>
|
|
||||||
/// Верхняя кооридната прорисовки самолета
|
|
||||||
/// </summary>
|
|
||||||
protected int _startPosY;
|
|
||||||
/// <summary>
|
|
||||||
/// Ширина прорисовки самолета
|
|
||||||
/// </summary>
|
|
||||||
protected readonly int _airPlaneWidth = 100;
|
|
||||||
/// <summary>
|
|
||||||
/// Высота прорисовки самолета
|
|
||||||
/// </summary>
|
|
||||||
protected readonly int _airPlaneHeight = 55;
|
|
||||||
/// <summary>
|
|
||||||
/// Конструктор
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="speed">Скорость</param>
|
|
||||||
/// <param name="weight">Вес</param>
|
|
||||||
/// <param name="bodyColor">Основной цвет</param>
|
|
||||||
/// <param name="width">Ширина картинки</param>
|
|
||||||
/// <param name="height">Высота картинки</param>
|
|
||||||
public DrawningAirPlane(int speed, double weight, Color bodyColor, int
|
|
||||||
width, int height)
|
|
||||||
{
|
|
||||||
// TODO: Продумать проверки
|
|
||||||
_pictureWidth = width;
|
|
||||||
_pictureHeight = height;
|
|
||||||
EntityAirPlane = new EntityAirPlane(speed, weight, bodyColor);
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Конструктор
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="speed">Скорость</param>
|
|
||||||
/// <param name="weight">Вес</param>
|
|
||||||
/// <param name="bodyColor">Основной цвет</param>
|
|
||||||
/// <param name="width">Ширина картинки</param>
|
|
||||||
/// <param name="height">Высота картинки</param>
|
|
||||||
/// <param name="airPlaneWidth">Ширина прорисовки самолета</param>
|
|
||||||
/// <param name="airPlaneHeight">Высота прорисовки самолета</param>
|
|
||||||
protected DrawningAirPlane(int speed, double weight, Color bodyColor, int
|
|
||||||
width, int height, int airPlaneWidth, int airPlaneHeight)
|
|
||||||
{
|
|
||||||
// TODO: Продумать проверки
|
|
||||||
_pictureWidth = width;
|
|
||||||
_pictureHeight = height;
|
|
||||||
_airPlaneWidth = airPlaneWidth;
|
|
||||||
_airPlaneHeight = airPlaneHeight;
|
|
||||||
EntityAirPlane = new EntityAirPlane(speed, weight, bodyColor);
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Установка позиции
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="x">Координата X</param>
|
|
||||||
/// <param name="y">Координата Y</param>
|
|
||||||
public void SetPosition(int x, int y)
|
|
||||||
{
|
|
||||||
// TODO: Изменение x, y, если при установке объект выходит за границы
|
|
||||||
_startPosX = x;
|
|
||||||
_startPosY = y;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Изменение направления перемещения
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="direction">Направление</param>
|
|
||||||
public void MoveTransport(DirectionType direction)
|
|
||||||
{
|
|
||||||
if (EntityAirPlane == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
switch (direction)
|
|
||||||
{
|
|
||||||
//влево
|
|
||||||
case DirectionType.Left:
|
|
||||||
if (_startPosX - EntityAirPlane.Step > 0)
|
|
||||||
{
|
|
||||||
_startPosX -= (int)EntityAirPlane.Step;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
//вверх
|
|
||||||
case DirectionType.Up:
|
|
||||||
if (_startPosY - EntityAirPlane.Step > 0)
|
|
||||||
{
|
|
||||||
_startPosY -= (int)EntityAirPlane.Step;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
// вправо
|
|
||||||
case DirectionType.Right:
|
|
||||||
// TODO: Продумать логику
|
|
||||||
break;
|
|
||||||
//вниз
|
|
||||||
case DirectionType.Down:
|
|
||||||
// TODO: Продумать логику
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Прорисовка объекта
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="g"></param>
|
|
||||||
public virtual void DrawPlane(Graphics g)
|
|
||||||
{
|
|
||||||
if (EntityAirPlane == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Pen pen = new(Color.Black);
|
|
||||||
Brush bodyColor = new SolidBrush(EntityAirPlane.BodyColor);
|
|
||||||
Brush wingsColor = new SolidBrush(Color.DeepPink);
|
|
||||||
g.FillPolygon(bodyColor, new Point[] //nose
|
|
||||||
{
|
|
||||||
new Point(_startPosX + 19, _startPosY + 50),
|
|
||||||
new Point(_startPosX + 19, _startPosY + 69),
|
|
||||||
new Point(_startPosX + 1, _startPosY + 59),
|
|
||||||
}
|
|
||||||
);
|
|
||||||
g.FillRectangle(bodyColor, _startPosX + 20, _startPosY + 50, 120, 20); //body
|
|
||||||
g.FillPolygon(bodyColor, new Point[] //up left wing
|
|
||||||
{
|
|
||||||
new Point(_startPosX + 36, _startPosY + 49),
|
|
||||||
new Point(_startPosX + 36, _startPosY + 1),
|
|
||||||
new Point(_startPosX + 45, _startPosY + 1),
|
|
||||||
new Point(_startPosX + 55, _startPosY + 49),
|
|
||||||
}
|
|
||||||
);
|
|
||||||
g.FillPolygon(bodyColor, new Point[] //down left wing
|
|
||||||
{
|
|
||||||
new Point(_startPosX + 36, _startPosY + 71),
|
|
||||||
new Point(_startPosX + 36, _startPosY + 116),
|
|
||||||
new Point(_startPosX + 45, _startPosY + 116),
|
|
||||||
new Point(_startPosX + 54, _startPosY + 71),
|
|
||||||
}
|
|
||||||
);
|
|
||||||
g.FillPolygon(wingsColor, new Point[] //up right wing
|
|
||||||
{
|
|
||||||
new Point(_startPosX + 120, _startPosY + 49),
|
|
||||||
new Point(_startPosX + 120, _startPosY + 42),
|
|
||||||
new Point(_startPosX + 140, _startPosY + 7),
|
|
||||||
new Point(_startPosX + 140, _startPosY + 49),
|
|
||||||
}
|
|
||||||
);
|
|
||||||
g.FillPolygon(wingsColor, new Point[] //down right wing
|
|
||||||
{
|
|
||||||
new Point(_startPosX + 120, _startPosY + 70),
|
|
||||||
new Point(_startPosX + 120, _startPosY + 77),
|
|
||||||
new Point(_startPosX + 140, _startPosY + 112),
|
|
||||||
new Point(_startPosX + 140, _startPosY + 70),
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
g.DrawPolygon(pen, new Point[] //nose
|
|
||||||
{
|
|
||||||
new Point(_startPosX + 20, _startPosY + 49),
|
|
||||||
new Point(_startPosX + 20, _startPosY + 70),
|
|
||||||
new Point(_startPosX, _startPosY + 59),
|
|
||||||
}
|
|
||||||
);
|
|
||||||
g.DrawRectangle(pen, _startPosX + 19, _startPosY + 49, 121, 21); //body
|
|
||||||
g.DrawPolygon(pen, new Point[] //up left wing
|
|
||||||
{
|
|
||||||
new Point(_startPosX + 35, _startPosY + 49),
|
|
||||||
new Point(_startPosX + 35, _startPosY),
|
|
||||||
new Point(_startPosX + 45, _startPosY),
|
|
||||||
new Point(_startPosX + 55, _startPosY + 49),
|
|
||||||
}
|
|
||||||
);
|
|
||||||
g.DrawPolygon(pen, new Point[] //down left wing
|
|
||||||
{
|
|
||||||
new Point(_startPosX + 36, _startPosY + 71),
|
|
||||||
new Point(_startPosX + 36, _startPosY + 116),
|
|
||||||
new Point(_startPosX + 45, _startPosY + 116),
|
|
||||||
new Point(_startPosX + 54, _startPosY + 71),
|
|
||||||
}
|
|
||||||
);
|
|
||||||
g.DrawPolygon(pen, new Point[] //up right wing
|
|
||||||
{
|
|
||||||
new Point(_startPosX + 120, _startPosY + 49),
|
|
||||||
new Point(_startPosX + 120, _startPosY + 42),
|
|
||||||
new Point(_startPosX + 140, _startPosY + 7),
|
|
||||||
new Point(_startPosX + 140, _startPosY + 49),
|
|
||||||
}
|
|
||||||
);
|
|
||||||
g.DrawPolygon(pen, new Point[] //down right wing
|
|
||||||
{
|
|
||||||
new Point(_startPosX + 120, _startPosY + 70),
|
|
||||||
new Point(_startPosX + 120, _startPosY + 77),
|
|
||||||
new Point(_startPosX + 140, _startPosY + 112),
|
|
||||||
new Point(_startPosX + 140, _startPosY + 70),
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -6,15 +6,22 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace AirBomber
|
namespace AirBomber
|
||||||
{
|
{
|
||||||
public class EntityAirBomber : EntityAirPlane
|
public class EntityAirBomber
|
||||||
{
|
{
|
||||||
|
public int Speed { get; private set; }
|
||||||
|
public double Weight { get; private set; }
|
||||||
|
public Color BodyColor { get; private set; }
|
||||||
public Color AdditionalColor { get; private set; }
|
public Color AdditionalColor { get; private set; }
|
||||||
public bool Bombs { get; private set; }
|
public bool Bombs { get; private set; }
|
||||||
public Color BombsColor { get; private set; }
|
public Color BombsColor { get; private set; }
|
||||||
public bool FuelTanks { get; private set; }
|
public bool FuelTanks { get; private set; }
|
||||||
public EntityAirBomber(int speed, double weight, Color bodyColor, Color
|
public double Step => (double)Speed * 100 / Weight;
|
||||||
|
public void Init(int speed, double weight, Color bodyColor, Color
|
||||||
additionalColor, bool bombs, Color bombsColor, bool fuelTanks)
|
additionalColor, bool bombs, Color bombsColor, bool fuelTanks)
|
||||||
{
|
{
|
||||||
|
Speed = speed;
|
||||||
|
Weight = weight;
|
||||||
|
BodyColor = bodyColor;
|
||||||
AdditionalColor = additionalColor;
|
AdditionalColor = additionalColor;
|
||||||
Bombs = bombs;
|
Bombs = bombs;
|
||||||
BombsColor = bombsColor;
|
BombsColor = bombsColor;
|
||||||
|
@ -1,41 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace AirBomber
|
|
||||||
{
|
|
||||||
public class EntityAirPlane
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Скорость
|
|
||||||
/// </summary>
|
|
||||||
public int Speed { get; private set; }
|
|
||||||
/// <summary>
|
|
||||||
/// Вес
|
|
||||||
/// </summary>
|
|
||||||
public double Weight { get; private set; }
|
|
||||||
/// <summary>
|
|
||||||
/// Основной цвет
|
|
||||||
/// </summary>
|
|
||||||
public Color BodyColor { get; private set; }
|
|
||||||
/// <summary>
|
|
||||||
/// Шаг перемещения самолета
|
|
||||||
/// </summary>
|
|
||||||
public double Step => (double)Speed * 100 / Weight;
|
|
||||||
/// <summary>
|
|
||||||
/// Конструктор с параметрами
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="speed">Скорость</param>
|
|
||||||
/// <param name="weight">Вес самолета</param>
|
|
||||||
/// <param name="bodyColor">Основной цвет</param>
|
|
||||||
public EntityAirPlane(int speed, double weight, Color bodyColor)
|
|
||||||
{
|
|
||||||
Speed = speed;
|
|
||||||
Weight = weight;
|
|
||||||
BodyColor = bodyColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user