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); g.DrawPolygon(pen, horns2);
} }
base.DrawTransport(g); base.DrawTransport(g);
} }
} }
} }

View File

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

View File

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

View File

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

View File

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