diff --git a/AircraftCarrier/AircraftCarrier/DrawingAircraftCarrier.cs b/AircraftCarrier/AircraftCarrier/DrawingAircraftCarrier.cs new file mode 100644 index 0000000..f85e406 --- /dev/null +++ b/AircraftCarrier/AircraftCarrier/DrawingAircraftCarrier.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AircraftCarrier +{ + internal class DrawingAircraftCarrier : DrawingWarship + { + /// + /// Инициализация свойств + /// + /// Скорость + /// Вес автомобиля + /// Цвет кузова + /// Дополнительный цвет + /// Признак наличия обвеса + /// Признак наличия антикрыла + /// Признак наличия гоночной полосы + public DrawingAircraftCarrier(int speed, float weight, Color bodyColor, Color dopColor, bool bodyKit, bool wing, bool sportLine) : + base(speed, weight, bodyColor, 110, 60) + { + Warship = new EntityAircraftCarrier(speed, weight, bodyColor, dopColor, bodyKit, wing, sportLine); + } + + public override void DrawTransport(Graphics g) + { + base.DrawTransport(g); + } + } + +} diff --git a/AircraftCarrier/AircraftCarrier/DrawingWarship.cs b/AircraftCarrier/AircraftCarrier/DrawingWarship.cs index a97c5df..0f377aa 100644 --- a/AircraftCarrier/AircraftCarrier/DrawingWarship.cs +++ b/AircraftCarrier/AircraftCarrier/DrawingWarship.cs @@ -14,7 +14,7 @@ namespace AircraftCarrier /// /// Класс-сущность /// - public EntityWarship Warship { get; private set; } + public EntityWarship Warship { get; protected set; } /// /// Левая координата отрисовки военного корабля /// @@ -49,6 +49,21 @@ namespace AircraftCarrier { Warship = new EntityWarship(speed, weight, bodyColor); } + + /// + /// Инициализация свойств + /// + /// Скорость + /// Вес военного корабля + /// Цвет главной палубы + /// Ширина отрисовки автомобиля + /// Высота отрисовки автомобиля + protected DrawingWarship(int speed, float weight, Color bodyColor, int warshipWidth, int warshipHeight) : + this(speed, weight, bodyColor) + { + _warshipWidth = warshipWidth; + _warshipHeight = warshipHeight; + } /// /// Установка позиции военного корабля /// @@ -127,7 +142,7 @@ namespace AircraftCarrier /// Отрисовка военного корабля /// /// - public void DrawTransport(Graphics g) + public virtual void DrawTransport(Graphics g) { if (_startPosX < 0 || _startPosY < 0 || !_pictureHeight.HasValue || !_pictureWidth.HasValue) diff --git a/AircraftCarrier/AircraftCarrier/EntityAircraftCarrier.cs b/AircraftCarrier/AircraftCarrier/EntityAircraftCarrier.cs new file mode 100644 index 0000000..e99bdbd --- /dev/null +++ b/AircraftCarrier/AircraftCarrier/EntityAircraftCarrier.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AircraftCarrier +{ + internal class EntityAircraftCarrier : EntityWarship + { + /// + /// Дополнительный цвет + /// + public Color DopColor { get; private set; } + /// + /// Признак наличия обвеса + /// + public bool BodyKit { get; private set; } + /// + /// Признак наличия антикрыла + /// + public bool Wing { get; private set; } + /// + /// Признак наличия гоночной полосы + /// + public bool SportLine { get; private set; } + /// + /// Инициализация свойств + /// + /// Скорость + /// Вес автомобиля + /// Цвет кузова + /// Дополнительный цвет + /// Признак наличия обвеса + /// Признак наличия антикрыла + /// Признак наличия гоночной полосы + public EntityAircraftCarrier(int speed, float weight, Color bodyColor, Color dopColor, bool bodyKit, bool wing, bool sportLine) : + base(speed, weight, bodyColor) + { + DopColor = dopColor; + BodyKit = bodyKit; + Wing = wing; + SportLine = sportLine; + } + } +}