ISEbd21 Zinovev V.V. Lab Work 02 #2

Closed
vladimir_zinovev wants to merge 3 commits from TankBasicLabSecond into TankBasicLabFirst
4 changed files with 4 additions and 11 deletions
Showing only changes of commit 04570866d9 - Show all commits

View File

@ -130,7 +130,6 @@ namespace ProjectTank.DrawningObjects
Brush blackColorBrush = new SolidBrush(Color.Black);
Brush bodyBrush = new SolidBrush(EntityArmoredTransport.BodyColor);
// Границы автомобиля
// гусеницы
g.DrawEllipse(pen, _startPosX + 14, _startPosY + 44, 151, 31);
@ -145,11 +144,10 @@ namespace ProjectTank.DrawningObjects
// Кузов
g.DrawRectangle(pen, _startPosX + 19, _startPosY + 34, 141, 21);
g.FillRectangle(bodyBrush, _startPosX + 20, _startPosY + 35, 140, 20);
// Башня
g.FillRectangle(blackColorBrush, _startPosX + 75, _startPosY + 10, 25, 5);
g.DrawRectangle(pen, _startPosX + 64, _startPosY + 14, 66, 21);
g.FillRectangle(bodyBrush, _startPosX + 65, _startPosY + 15, 65, 20); //*** -> bodyBrush <- additionalBrush
g.FillRectangle(bodyBrush, _startPosX + 65, _startPosY + 15, 65, 20);
//Точки для отрисовки передней и задней части
Point pointFirstBackSide = new Point(_startPosX + 18, _startPosY + 35);
@ -158,7 +156,6 @@ namespace ProjectTank.DrawningObjects
Point pointFirstFrontSide = new Point(_startPosX + 162, _startPosY + 35);
Point pointSecondFrontSide = new Point(_startPosX + 185, _startPosY + 55);
Point pointThirdFrontSide = new Point(_startPosX + 162, _startPosY + 55);
// Задняя часть
Point[] backSide = { pointFirstBackSide, pointSecondBackSide, pointThirdBackSide };
g.DrawPolygon(pen, backSide);

View File

@ -9,7 +9,7 @@ namespace ProjectTank.MovementStrategy
{
/// <summary>
/// Реализация интерфейса IDrawningObject для работы с объектом DrawningCar(паттерн Adapter)
/// </summary>
/// </summary>
public class DrawningObjectArmoredTransport : IMoveableObject
{
private readonly DrawningArmoredTransport? _drawningArmoredTransport = null;

View File

@ -26,13 +26,12 @@ namespace ProjectTank.DrawningObjects
/// <param name="width">Ширина картинки</param>
/// <param name="height">Высота картинки</param>
public DrawningTank(int speed, double weight, Color bodyColor, Color
additionalColor, bool gun, bool machineGun, int width, int height) :
base(speed, weight, bodyColor, width, height, 200, 80)
additionalColor, bool gun, bool machineGun, int width, int height) : base(speed,weight, bodyColor, width, height, 200, 80)
{
if (EntityArmoredTransport != null)
{
EntityArmoredTransport = new EntityTank(speed, weight, bodyColor,
additionalColor, gun, machineGun);
additionalColor, gun, machineGun);
}
}
public override void DrawTransport(Graphics g)

View File

@ -16,17 +16,14 @@ namespace ProjectTank.Entities
/// Дополнительный цвет (для опциональных элементов)
/// </summary>
public Color AdditionalColor { get; private set; }
/// <summary>
/// Пушка
/// </summary>
public bool Gun { get; private set; }
/// <summary>
/// Пулемет
/// </summary>
public bool MachineGun { get; private set; }
/// <summary>
/// Инициализация полей объекта-класса спортивного автомобиля
/// </summary>