Сохранение
This commit is contained in:
parent
33d1b6d846
commit
48a9ca1a44
@ -16,6 +16,7 @@ namespace WarmlyShip
|
|||||||
private readonly int _warmlyShipWidth = 125; //Ширина отрисовки корабля
|
private readonly int _warmlyShipWidth = 125; //Ширина отрисовки корабля
|
||||||
private readonly int _warmlyShipHeight = 50; //Высота отрисовки корабля
|
private readonly int _warmlyShipHeight = 50; //Высота отрисовки корабля
|
||||||
|
|
||||||
|
//Конструктор класса
|
||||||
public DrawingWarmlyShip(int speed, float weight, Color bodyColor)
|
public DrawingWarmlyShip(int speed, float weight, Color bodyColor)
|
||||||
{
|
{
|
||||||
warmlyShip = new EntityWarmlyShip(speed, weight, bodyColor);
|
warmlyShip = new EntityWarmlyShip(speed, weight, bodyColor);
|
||||||
@ -27,6 +28,7 @@ namespace WarmlyShip
|
|||||||
_warmlyShipHeight = warmlyHeight;
|
_warmlyShipHeight = warmlyHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Начальная позиция коробля
|
||||||
public void SetPosition(int x, int y, int width, int height)
|
public void SetPosition(int x, int y, int width, int height)
|
||||||
{
|
{
|
||||||
if (width < _warmlyShipWidth || height < _warmlyShipHeight) return;
|
if (width < _warmlyShipWidth || height < _warmlyShipHeight) return;
|
||||||
@ -37,6 +39,7 @@ namespace WarmlyShip
|
|||||||
_pictureHeight = height;
|
_pictureHeight = height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Функция передвижения объекта
|
||||||
public void MoveTransport(Direction direction)
|
public void MoveTransport(Direction direction)
|
||||||
{
|
{
|
||||||
if (!_pictureWidth.HasValue || !_pictureHeight.HasValue) return;
|
if (!_pictureWidth.HasValue || !_pictureHeight.HasValue) return;
|
||||||
@ -57,6 +60,7 @@ namespace WarmlyShip
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Отрисовка транспорта
|
||||||
public virtual void DrawTransport(Graphics g)
|
public virtual void DrawTransport(Graphics g)
|
||||||
{
|
{
|
||||||
if (_startPosX < 0 || _startPosY < 0 || !_pictureHeight.HasValue || !_pictureWidth.HasValue)
|
if (_startPosX < 0 || _startPosY < 0 || !_pictureHeight.HasValue || !_pictureWidth.HasValue)
|
||||||
@ -89,6 +93,7 @@ namespace WarmlyShip
|
|||||||
g.DrawEllipse(new(Color.Blue, 2), _startPosX + _warmlyShipWidth * 2 / 5 + 2.5f, _startPosY + 25, 20, 20);
|
g.DrawEllipse(new(Color.Blue, 2), _startPosX + _warmlyShipWidth * 2 / 5 + 2.5f, _startPosY + 25, 20, 20);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Изменение границ отрисовки
|
||||||
public void ChangeBorders(int width, int height)
|
public void ChangeBorders(int width, int height)
|
||||||
{
|
{
|
||||||
_pictureWidth = width;
|
_pictureWidth = width;
|
||||||
|
@ -12,6 +12,7 @@ namespace WarmlyShip
|
|||||||
public bool BodyKit { get; private set; }
|
public bool BodyKit { get; private set; }
|
||||||
public bool Wing { get; private set; }
|
public bool Wing { get; private set; }
|
||||||
public bool SportLine { get; private set; }
|
public bool SportLine { get; private set; }
|
||||||
|
|
||||||
public EntityMotorShip(int speed, float weight, Color bodyColor, Color dopColor, bool bodyKit, bool wing, bool sportLine) : base(speed, weight, bodyColor)
|
public EntityMotorShip(int speed, float weight, Color bodyColor, Color dopColor, bool bodyKit, bool wing, bool sportLine) : base(speed, weight, bodyColor)
|
||||||
{
|
{
|
||||||
DopColor = dopColor;
|
DopColor = dopColor;
|
||||||
|
Loading…
Reference in New Issue
Block a user