Full Lab
This commit is contained in:
parent
e0e745cd3a
commit
fa09914efb
@ -59,10 +59,7 @@ namespace ElectricLocomotive
|
||||
g.DrawPolygon(pen, horns2);
|
||||
}
|
||||
base.DrawTransport(g);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -19,8 +19,7 @@ namespace ElectricLocomotive
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_drawningLocomotive == null || _drawningLocomotive.EntityLocomotive ==
|
||||
null)
|
||||
if (_drawningLocomotive == null || _drawningLocomotive.EntityLocomotive == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -7,7 +7,6 @@ using System.Threading.Tasks;
|
||||
namespace ElectricLocomotive.Entities
|
||||
{
|
||||
public class EntityLocomotive
|
||||
|
||||
{
|
||||
/// <summary>
|
||||
/// Скорость
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user