This commit is contained in:
Игорь Гордеев 2023-11-16 16:07:19 +04:00
parent e0e745cd3a
commit fa09914efb
5 changed files with 1 additions and 36 deletions

View File

@ -59,10 +59,7 @@ namespace ElectricLocomotive
g.DrawPolygon(pen, horns2);
}
base.DrawTransport(g);
}
}
}

View File

@ -30,7 +30,6 @@ namespace ElectricLocomotive.DrawningObject
public int GetWidth => _locoWidth;
public int GetHeight => _locoHeight;
public DrawningLocomotive(int speed, double weight, Color bodyColor, Color additionalColor, int width, int heigth)
{
if (width < _locoWidth || heigth < _locoHeight)
@ -184,7 +183,6 @@ namespace ElectricLocomotive.DrawningObject
///дверь
g.FillRectangle(brush, _startPosX + 50, _startPosY + 15, 10, 25);
///Батарея
g.FillRectangle(brush, _startPosX + 45, _startPosY + 5, 15, 5);

View File

@ -19,8 +19,7 @@ namespace ElectricLocomotive
{
get
{
if (_drawningLocomotive == null || _drawningLocomotive.EntityLocomotive ==
null)
if (_drawningLocomotive == null || _drawningLocomotive.EntityLocomotive == null)
{
return null;
}

View File

@ -7,7 +7,6 @@ using System.Threading.Tasks;
namespace ElectricLocomotive.Entities
{
public class EntityLocomotive
{
/// <summary>
/// Скорость

View File

@ -12,37 +12,10 @@ namespace ElectricLocomotive
private readonly int _y;
private readonly int _width;
private readonly int _height;
/// <summary>
/// Левая граница
/// </summary>
public int LeftBorder => _x;
/// <summary>
/// Верхняя граница
/// </summary>
public int TopBorder => _y;
/// <summary>
/// Правая граница
/// </summary>
public int RightBorder => _x + _width;
/// <summary>
/// Нижняя граница
/// </summary>
public int DownBorder => _y + _height;
/// <summary>
/// Середина объекта
/// </summary>
public int ObjectMiddleHorizontal => _x + _width / 2;
/// <summary>
/// Середина объекта
/// </summary>
public int ObjectMiddleVertical => _y + _height / 2;
/// <summary>
/// Конструктор
/// </summary>
/// <param name="x">Координата X</param>
/// <param name="y">Координата Y</param>
/// <param name="width">Ширина</param>
/// <param name="height">Высота</param>
public ObjectParameters(int x, int y, int width, int height)
{
_x = x;
@ -50,6 +23,5 @@ namespace ElectricLocomotive
_width = width;
_height = height;
}
}
}