Сделал лабораторную 3
This commit is contained in:
parent
0f4098ad95
commit
40cd0e854b
@ -1,4 +1,5 @@
|
|||||||
using Bulldozer.Entities;
|
using Bulldozer.Entities;
|
||||||
|
using Bulldozer.MovementStrategy;
|
||||||
|
|
||||||
namespace Bulldozer.DrawingObjects
|
namespace Bulldozer.DrawingObjects
|
||||||
{
|
{
|
||||||
@ -45,34 +46,30 @@ namespace Bulldozer.DrawingObjects
|
|||||||
/// <param name="width">Ширина картинки</param>
|
/// <param name="width">Ширина картинки</param>
|
||||||
/// <param name="height">Высота картинки</param>
|
/// <param name="height">Высота картинки</param>
|
||||||
public DrawingBulldozer(int speed, double weight, Color bodyColor, Color additionalColor, int width, int height)
|
public DrawingBulldozer(int speed, double weight, Color bodyColor, Color additionalColor, int width, int height)
|
||||||
{
|
|
||||||
if (width < _bulldozerWidth || height < _bulldozerHeight)
|
|
||||||
{
|
|
||||||
width += _bulldozerWidth * 2;
|
|
||||||
height += _bulldozerHeight * 2;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
_pictureWidth = width;
|
_pictureWidth = width;
|
||||||
_pictureHeight = height;
|
_pictureHeight = height;
|
||||||
EntityBulldozer = new EntityBulldozer(speed, weight, bodyColor, additionalColor);
|
EntityBulldozer = new EntityBulldozer(speed, weight, bodyColor, additionalColor);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Конструктор
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="speed">Скорость</param>
|
||||||
|
/// <param name="weight">Вес</param>
|
||||||
|
/// <param name="bodyColor">Основной цвет</param>
|
||||||
|
/// <param name="width">Ширина картинки</param>
|
||||||
|
/// <param name="height">Высота картинки</param>
|
||||||
|
/// <param name="carWidth">Ширина прорисовки бульдозера</param>
|
||||||
|
/// <param name="carHeight">Высота прорисовки бульдозера</param>
|
||||||
protected DrawingBulldozer(int speed, double weight, Color bodyColor, Color additionalColor, int width, int height, int bulldozerWidth, int bulldozerHeight)
|
protected DrawingBulldozer(int speed, double weight, Color bodyColor, Color additionalColor, int width, int height, int bulldozerWidth, int bulldozerHeight)
|
||||||
{
|
|
||||||
if (width < _bulldozerWidth || height < _bulldozerHeight)
|
|
||||||
{
|
|
||||||
width += _bulldozerWidth * 2;
|
|
||||||
height += _bulldozerHeight * 2;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
_pictureWidth = width;
|
_pictureWidth = width;
|
||||||
_pictureHeight = height;
|
_pictureHeight = height;
|
||||||
|
_bulldozerWidth = bulldozerWidth;
|
||||||
|
_bulldozerHeight = bulldozerHeight;
|
||||||
EntityBulldozer = new EntityBulldozer(speed, weight, bodyColor, additionalColor);
|
EntityBulldozer = new EntityBulldozer(speed, weight, bodyColor, additionalColor);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Установка позиции
|
/// Установка позиции
|
||||||
@ -82,16 +79,15 @@ namespace Bulldozer.DrawingObjects
|
|||||||
|
|
||||||
public void SetPosition(int x, int y)
|
public void SetPosition(int x, int y)
|
||||||
{
|
{
|
||||||
if (x < 0 || y < 0)
|
// Проверка границ
|
||||||
{
|
if (x < 0) x = 0;
|
||||||
_startPosX = 0; _startPosY = 0;
|
if (y < 0) y = 0;
|
||||||
}
|
if (x > _pictureWidth - _bulldozerWidth) x = _pictureWidth - _bulldozerWidth;
|
||||||
else
|
if (y > _pictureHeight - _bulldozerHeight) y = _pictureHeight - _bulldozerHeight;
|
||||||
{
|
|
||||||
_startPosX = x;
|
_startPosX = x;
|
||||||
_startPosY = y;
|
_startPosY = y;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Координата X объекта
|
/// Координата X объекта
|
||||||
@ -122,13 +118,13 @@ namespace Bulldozer.DrawingObjects
|
|||||||
}
|
}
|
||||||
return direction switch
|
return direction switch
|
||||||
{
|
{
|
||||||
//влево
|
// влево
|
||||||
DirectionType.Left => _startPosX - EntityBulldozer.Step > 0,
|
DirectionType.Left => _startPosX - EntityBulldozer.Step > 0,
|
||||||
//вверх
|
// вверх
|
||||||
DirectionType.Up => _startPosY - EntityBulldozer.Step > 0,
|
DirectionType.Up => _startPosY - EntityBulldozer.Step > 0,
|
||||||
// вправо
|
// вправо
|
||||||
DirectionType.Right => _startPosX + EntityBulldozer.Step < _pictureWidth,
|
DirectionType.Right => _startPosX + EntityBulldozer.Step < _pictureWidth,
|
||||||
//вниз
|
// вниз
|
||||||
DirectionType.Down => _startPosY + EntityBulldozer.Step < _pictureHeight,
|
DirectionType.Down => _startPosY + EntityBulldozer.Step < _pictureHeight,
|
||||||
_ => false,
|
_ => false,
|
||||||
};
|
};
|
||||||
@ -137,7 +133,7 @@ namespace Bulldozer.DrawingObjects
|
|||||||
/// Изменение направления перемещения
|
/// Изменение направления перемещения
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="direction">Направление</param>
|
/// <param name="direction">Направление</param>
|
||||||
public virtual void MoveBulldozer(DirectionType direction)
|
public void MoveBulldozer(DirectionType direction)
|
||||||
{
|
{
|
||||||
if (!CanMove(direction) || EntityBulldozer == null)
|
if (!CanMove(direction) || EntityBulldozer == null)
|
||||||
{
|
{
|
||||||
@ -176,12 +172,12 @@ namespace Bulldozer.DrawingObjects
|
|||||||
Pen pen = new(Color.Black);
|
Pen pen = new(Color.Black);
|
||||||
Brush bodyBrush = new SolidBrush(EntityBulldozer.BodyColor);
|
Brush bodyBrush = new SolidBrush(EntityBulldozer.BodyColor);
|
||||||
Brush additionalBrush = new SolidBrush(EntityBulldozer.AdditionalColor);
|
Brush additionalBrush = new SolidBrush(EntityBulldozer.AdditionalColor);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Заливка гусеницы бульдозера
|
/// Заливка гусеницы бульдозера
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Brush brGray = new SolidBrush(Color.Gray);
|
|
||||||
|
|
||||||
|
|
||||||
|
Brush brGray = new SolidBrush(Color.Gray);
|
||||||
g.FillEllipse(brGray, _startPosX + 17, _startPosY + 24, 119, 40); //Гусеница
|
g.FillEllipse(brGray, _startPosX + 17, _startPosY + 24, 119, 40); //Гусеница
|
||||||
g.FillEllipse(additionalBrush, _startPosX + 20, _startPosY + 35, 20, 20); // Левое колесо гусеницы
|
g.FillEllipse(additionalBrush, _startPosX + 20, _startPosY + 35, 20, 20); // Левое колесо гусеницы
|
||||||
g.FillEllipse(additionalBrush, _startPosX + 115, _startPosY + 35, 20, 20); // Правое колесо гусеницы
|
g.FillEllipse(additionalBrush, _startPosX + 115, _startPosY + 35, 20, 20); // Правое колесо гусеницы
|
||||||
@ -189,16 +185,20 @@ namespace Bulldozer.DrawingObjects
|
|||||||
g.FillEllipse(additionalBrush, _startPosX + 70, _startPosY + 45, 10, 10); // 2 центральное колесо гусеницы
|
g.FillEllipse(additionalBrush, _startPosX + 70, _startPosY + 45, 10, 10); // 2 центральное колесо гусеницы
|
||||||
g.FillEllipse(additionalBrush, _startPosX + 90, _startPosY + 45, 10, 10); // 3 центральное колесо гусеницы
|
g.FillEllipse(additionalBrush, _startPosX + 90, _startPosY + 45, 10, 10); // 3 центральное колесо гусеницы
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Отрисовка границ бульдозера
|
/// Отрисовка границ бульдозера
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
g.DrawEllipse(pen, _startPosX + 17, _startPosY + 24, 119, 40);
|
||||||
g.DrawEllipse(pen, _startPosX + 20, _startPosY + 35, 20, 20); // Левое колесо гусеницы
|
g.DrawEllipse(pen, _startPosX + 20, _startPosY + 35, 20, 20); // Левое колесо гусеницы
|
||||||
g.DrawEllipse(pen, _startPosX + 115, _startPosY + 35, 20, 20); // Правое колесо гусеницы
|
g.DrawEllipse(pen, _startPosX + 115, _startPosY + 35, 20, 20); // Правое колесо гусеницы
|
||||||
g.DrawEllipse(pen, _startPosX + 50, _startPosY + 45, 10, 10); // 1 центральное колесо гусеницы
|
g.DrawEllipse(pen, _startPosX + 50, _startPosY + 45, 10, 10); // 1 центральное колесо гусеницы
|
||||||
g.DrawEllipse(pen, _startPosX + 70, _startPosY + 45, 10, 10); // 2 центральное колесо гусеницы
|
g.DrawEllipse(pen, _startPosX + 70, _startPosY + 45, 10, 10); // 2 центральное колесо гусеницы
|
||||||
g.DrawEllipse(pen, _startPosX + 90, _startPosY + 45, 10, 10); // 3 центральное колесо гусеницы
|
g.DrawEllipse(pen, _startPosX + 90, _startPosY + 45, 10, 10); // 3 центральное колесо гусеницы
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Кузов бульдозера
|
/// Кузов бульдозера
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -212,6 +212,10 @@ namespace Bulldozer.DrawingObjects
|
|||||||
g.DrawRectangle(pen, _startPosX + 17, _startPosY + 24, 119, 18); // основная часть
|
g.DrawRectangle(pen, _startPosX + 17, _startPosY + 24, 119, 18); // основная часть
|
||||||
g.DrawRectangle(pen, _startPosX + 30, _startPosY, 10, 24); // выхлопная труба
|
g.DrawRectangle(pen, _startPosX + 30, _startPosY, 10, 24); // выхлопная труба
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Получение объекта IMoveableObject из объекта DrawingBulldozer
|
||||||
|
/// </summary>
|
||||||
|
public IMoveableObject GetMoveableObject => new DrawingObjectBulldozer(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,6 @@ namespace Bulldozer.DrawingObjects
|
|||||||
/// <param name="weight">Вес</param>
|
/// <param name="weight">Вес</param>
|
||||||
/// <param name="bodyColor">Основной цвет</param>
|
/// <param name="bodyColor">Основной цвет</param>
|
||||||
/// <param name="additionalColor">Дополнительный цвет</param>
|
/// <param name="additionalColor">Дополнительный цвет</param>
|
||||||
/// <param name="additionalColor">Цвет обвесов</param>
|
|
||||||
/// <param name="blade">Признак наличия рыхлителя</param>
|
/// <param name="blade">Признак наличия рыхлителя</param>
|
||||||
/// <param name="ripper">Признак наличия отвала</param>
|
/// <param name="ripper">Признак наличия отвала</param>
|
||||||
/// <param name="width">Ширина картинки</param>
|
/// <param name="width">Ширина картинки</param>
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
namespace Bulldozer.Entities
|
using System.Windows.Forms.Design;
|
||||||
|
|
||||||
|
namespace Bulldozer.Entities
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Класс-сущность "Бульдозер"
|
/// Класс-сущность "Бульдозер"
|
||||||
@ -17,10 +19,10 @@
|
|||||||
/// Основной цвет
|
/// Основной цвет
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Color BodyColor { get; private set; }
|
public Color BodyColor { get; private set; }
|
||||||
/// <summary>
|
|
||||||
/// Дополнительный цвет
|
|
||||||
/// </summary>
|
|
||||||
public Color AdditionalColor { get; private set; }
|
public Color AdditionalColor { get; private set; }
|
||||||
|
|
||||||
|
public Color DopColor { get; private set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Шаг перемещения бульдозера
|
/// Шаг перемещения бульдозера
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -31,7 +33,6 @@
|
|||||||
/// <param name="speed">Скорость</param>
|
/// <param name="speed">Скорость</param>
|
||||||
/// <param name="weight">Вес бульдозера</param>
|
/// <param name="weight">Вес бульдозера</param>
|
||||||
/// <param name="bodyColor">Основной цвет</param>
|
/// <param name="bodyColor">Основной цвет</param>
|
||||||
/// <param name="additionalColor">Дополнительный цвет</param>
|
|
||||||
public EntityBulldozer(int speed, double weight, Color bodyColor, Color additionalColor)
|
public EntityBulldozer(int speed, double weight, Color bodyColor, Color additionalColor)
|
||||||
{
|
{
|
||||||
Speed = speed;
|
Speed = speed;
|
||||||
@ -40,5 +41,7 @@
|
|||||||
AdditionalColor = additionalColor;
|
AdditionalColor = additionalColor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
241
Bulldozer/Bulldozer/FormBulldozer.Designer.cs
generated
241
Bulldozer/Bulldozer/FormBulldozer.Designer.cs
generated
@ -28,144 +28,168 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
pictureBoxBulldozer = new PictureBox();
|
this.pictureBoxBulldozer = new System.Windows.Forms.PictureBox();
|
||||||
buttonCreateBulldozer = new Button();
|
this.buttonCreateBulldozer = new System.Windows.Forms.Button();
|
||||||
buttonLeft = new Button();
|
this.buttonLeft = new System.Windows.Forms.Button();
|
||||||
buttonDown = new Button();
|
this.buttonDown = new System.Windows.Forms.Button();
|
||||||
buttonRight = new Button();
|
this.buttonRight = new System.Windows.Forms.Button();
|
||||||
buttonUp = new Button();
|
this.buttonUp = new System.Windows.Forms.Button();
|
||||||
comboBoxStrategy = new ComboBox();
|
this.comboBoxStrategy = new System.Windows.Forms.ComboBox();
|
||||||
buttonStep = new Button();
|
this.buttonStep = new System.Windows.Forms.Button();
|
||||||
buttonCreateUpgradedBulldozer = new Button();
|
this.buttonCreateUpgradedBulldozer = new System.Windows.Forms.Button();
|
||||||
((System.ComponentModel.ISupportInitialize)pictureBoxBulldozer).BeginInit();
|
this.buttonSelectBulldozer = new System.Windows.Forms.Button();
|
||||||
SuspendLayout();
|
((System.ComponentModel.ISupportInitialize)(this.pictureBoxBulldozer)).BeginInit();
|
||||||
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
// pictureBoxBulldozer
|
// pictureBoxBulldozer
|
||||||
//
|
//
|
||||||
pictureBoxBulldozer.Dock = DockStyle.Fill;
|
this.pictureBoxBulldozer.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||||
pictureBoxBulldozer.Location = new Point(0, 0);
|
this.pictureBoxBulldozer.Location = new System.Drawing.Point(0, 0);
|
||||||
pictureBoxBulldozer.Name = "pictureBoxBulldozer";
|
this.pictureBoxBulldozer.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||||
pictureBoxBulldozer.Size = new Size(884, 461);
|
this.pictureBoxBulldozer.Name = "pictureBoxBulldozer";
|
||||||
pictureBoxBulldozer.SizeMode = PictureBoxSizeMode.AutoSize;
|
this.pictureBoxBulldozer.Size = new System.Drawing.Size(1110, 793);
|
||||||
pictureBoxBulldozer.TabIndex = 0;
|
this.pictureBoxBulldozer.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
|
||||||
pictureBoxBulldozer.TabStop = false;
|
this.pictureBoxBulldozer.TabIndex = 0;
|
||||||
|
this.pictureBoxBulldozer.TabStop = false;
|
||||||
//
|
//
|
||||||
// buttonCreateBulldozer
|
// buttonCreateBulldozer
|
||||||
//
|
//
|
||||||
buttonCreateBulldozer.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
this.buttonCreateBulldozer.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||||
buttonCreateBulldozer.Location = new Point(12, 426);
|
this.buttonCreateBulldozer.Location = new System.Drawing.Point(14, 746);
|
||||||
buttonCreateBulldozer.Name = "buttonCreateBulldozer";
|
this.buttonCreateBulldozer.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||||
buttonCreateBulldozer.Size = new Size(132, 23);
|
this.buttonCreateBulldozer.Name = "buttonCreateBulldozer";
|
||||||
buttonCreateBulldozer.TabIndex = 1;
|
this.buttonCreateBulldozer.Size = new System.Drawing.Size(151, 31);
|
||||||
buttonCreateBulldozer.Text = "Создать бульдозер";
|
this.buttonCreateBulldozer.TabIndex = 1;
|
||||||
buttonCreateBulldozer.UseVisualStyleBackColor = true;
|
this.buttonCreateBulldozer.Text = "Создать бульдозер";
|
||||||
buttonCreateBulldozer.Click += buttonCreateBulldozer_Click;
|
this.buttonCreateBulldozer.UseVisualStyleBackColor = true;
|
||||||
|
this.buttonCreateBulldozer.Click += new System.EventHandler(this.buttonCreateBulldozer_Click);
|
||||||
//
|
//
|
||||||
// buttonLeft
|
// buttonLeft
|
||||||
//
|
//
|
||||||
buttonLeft.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
this.buttonLeft.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
buttonLeft.BackgroundImage = Properties.Resources.arrowLeft;
|
this.buttonLeft.BackgroundImage = global::Bulldozer.Properties.Resources.arrowLeft;
|
||||||
buttonLeft.BackgroundImageLayout = ImageLayout.Zoom;
|
this.buttonLeft.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
|
||||||
buttonLeft.Image = Properties.Resources.arrowLeft;
|
this.buttonLeft.Image = global::Bulldozer.Properties.Resources.arrowLeft;
|
||||||
buttonLeft.Location = new Point(759, 422);
|
this.buttonLeft.Location = new System.Drawing.Point(967, 741);
|
||||||
buttonLeft.Name = "buttonLeft";
|
this.buttonLeft.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||||
buttonLeft.Size = new Size(30, 30);
|
this.buttonLeft.Name = "buttonLeft";
|
||||||
buttonLeft.TabIndex = 2;
|
this.buttonLeft.Size = new System.Drawing.Size(34, 40);
|
||||||
buttonLeft.UseVisualStyleBackColor = true;
|
this.buttonLeft.TabIndex = 2;
|
||||||
buttonLeft.Click += ButtonMove_Click;
|
this.buttonLeft.UseVisualStyleBackColor = true;
|
||||||
|
this.buttonLeft.Click += new System.EventHandler(this.ButtonMove_Click);
|
||||||
//
|
//
|
||||||
// buttonDown
|
// buttonDown
|
||||||
//
|
//
|
||||||
buttonDown.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
this.buttonDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
buttonDown.BackgroundImage = Properties.Resources.arrowDown;
|
this.buttonDown.BackgroundImage = global::Bulldozer.Properties.Resources.arrowDown;
|
||||||
buttonDown.BackgroundImageLayout = ImageLayout.Zoom;
|
this.buttonDown.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
|
||||||
buttonDown.Location = new Point(795, 422);
|
this.buttonDown.Location = new System.Drawing.Point(1009, 741);
|
||||||
buttonDown.Name = "buttonDown";
|
this.buttonDown.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||||
buttonDown.Size = new Size(30, 30);
|
this.buttonDown.Name = "buttonDown";
|
||||||
buttonDown.TabIndex = 3;
|
this.buttonDown.Size = new System.Drawing.Size(34, 40);
|
||||||
buttonDown.UseVisualStyleBackColor = true;
|
this.buttonDown.TabIndex = 3;
|
||||||
buttonDown.Click += ButtonMove_Click;
|
this.buttonDown.UseVisualStyleBackColor = true;
|
||||||
|
this.buttonDown.Click += new System.EventHandler(this.ButtonMove_Click);
|
||||||
//
|
//
|
||||||
// buttonRight
|
// buttonRight
|
||||||
//
|
//
|
||||||
buttonRight.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
this.buttonRight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
buttonRight.BackgroundImage = Properties.Resources.arrowRight;
|
this.buttonRight.BackgroundImage = global::Bulldozer.Properties.Resources.arrowRight;
|
||||||
buttonRight.BackgroundImageLayout = ImageLayout.Zoom;
|
this.buttonRight.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
|
||||||
buttonRight.Image = Properties.Resources.arrowRight;
|
this.buttonRight.Image = global::Bulldozer.Properties.Resources.arrowRight;
|
||||||
buttonRight.Location = new Point(831, 422);
|
this.buttonRight.Location = new System.Drawing.Point(1050, 741);
|
||||||
buttonRight.Name = "buttonRight";
|
this.buttonRight.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||||
buttonRight.Size = new Size(30, 30);
|
this.buttonRight.Name = "buttonRight";
|
||||||
buttonRight.TabIndex = 4;
|
this.buttonRight.Size = new System.Drawing.Size(34, 40);
|
||||||
buttonRight.UseVisualStyleBackColor = true;
|
this.buttonRight.TabIndex = 4;
|
||||||
buttonRight.Click += ButtonMove_Click;
|
this.buttonRight.UseVisualStyleBackColor = true;
|
||||||
|
this.buttonRight.Click += new System.EventHandler(this.ButtonMove_Click);
|
||||||
//
|
//
|
||||||
// buttonUp
|
// buttonUp
|
||||||
//
|
//
|
||||||
buttonUp.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
this.buttonUp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||||
buttonUp.BackgroundImage = Properties.Resources.arrowUp;
|
this.buttonUp.BackgroundImage = global::Bulldozer.Properties.Resources.arrowUp;
|
||||||
buttonUp.BackgroundImageLayout = ImageLayout.Zoom;
|
this.buttonUp.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
|
||||||
buttonUp.Image = Properties.Resources.arrowUp;
|
this.buttonUp.Image = global::Bulldozer.Properties.Resources.arrowUp;
|
||||||
buttonUp.Location = new Point(795, 386);
|
this.buttonUp.Location = new System.Drawing.Point(1009, 693);
|
||||||
buttonUp.Name = "buttonUp";
|
this.buttonUp.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||||
buttonUp.Size = new Size(30, 30);
|
this.buttonUp.Name = "buttonUp";
|
||||||
buttonUp.TabIndex = 5;
|
this.buttonUp.Size = new System.Drawing.Size(34, 40);
|
||||||
buttonUp.UseVisualStyleBackColor = true;
|
this.buttonUp.TabIndex = 5;
|
||||||
buttonUp.Click += ButtonMove_Click;
|
this.buttonUp.UseVisualStyleBackColor = true;
|
||||||
|
this.buttonUp.Click += new System.EventHandler(this.ButtonMove_Click);
|
||||||
//
|
//
|
||||||
// comboBoxStrategy
|
// comboBoxStrategy
|
||||||
//
|
//
|
||||||
comboBoxStrategy.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
this.comboBoxStrategy.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
comboBoxStrategy.DropDownStyle = ComboBoxStyle.DropDownList;
|
this.comboBoxStrategy.FormattingEnabled = true;
|
||||||
comboBoxStrategy.FormattingEnabled = true;
|
this.comboBoxStrategy.Items.AddRange(new object[] {
|
||||||
comboBoxStrategy.Items.AddRange(new object[] { "Движение к центру", "Движение к правой нижней границе" });
|
"Движение к центру",
|
||||||
comboBoxStrategy.Location = new Point(642, 9);
|
"Движение к правой нижней границе"});
|
||||||
comboBoxStrategy.Margin = new Padding(3, 2, 3, 2);
|
this.comboBoxStrategy.Location = new System.Drawing.Point(834, 12);
|
||||||
comboBoxStrategy.Name = "comboBoxStrategy";
|
this.comboBoxStrategy.Name = "comboBoxStrategy";
|
||||||
comboBoxStrategy.Size = new Size(232, 23);
|
this.comboBoxStrategy.Size = new System.Drawing.Size(264, 28);
|
||||||
comboBoxStrategy.TabIndex = 6;
|
this.comboBoxStrategy.TabIndex = 6;
|
||||||
//
|
//
|
||||||
// buttonStep
|
// buttonStep
|
||||||
//
|
//
|
||||||
buttonStep.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
this.buttonStep.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||||
buttonStep.Location = new Point(821, 35);
|
this.buttonStep.Location = new System.Drawing.Point(1038, 47);
|
||||||
buttonStep.Name = "buttonStep";
|
this.buttonStep.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||||
buttonStep.Size = new Size(52, 23);
|
this.buttonStep.Name = "buttonStep";
|
||||||
buttonStep.TabIndex = 7;
|
this.buttonStep.Size = new System.Drawing.Size(60, 31);
|
||||||
buttonStep.Text = "Шаг";
|
this.buttonStep.TabIndex = 7;
|
||||||
buttonStep.UseVisualStyleBackColor = true;
|
this.buttonStep.Text = "Шаг";
|
||||||
buttonStep.Click += buttonStep_Click;
|
this.buttonStep.UseVisualStyleBackColor = true;
|
||||||
|
this.buttonStep.Click += new System.EventHandler(this.buttonStep_Click);
|
||||||
//
|
//
|
||||||
// buttonCreateUpgradedBulldozer
|
// buttonCreateUpgradedBulldozer
|
||||||
//
|
//
|
||||||
buttonCreateUpgradedBulldozer.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
this.buttonCreateUpgradedBulldozer.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||||
buttonCreateUpgradedBulldozer.Location = new Point(150, 426);
|
this.buttonCreateUpgradedBulldozer.Location = new System.Drawing.Point(171, 746);
|
||||||
buttonCreateUpgradedBulldozer.Name = "buttonCreateUpgradedBulldozer";
|
this.buttonCreateUpgradedBulldozer.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||||
buttonCreateUpgradedBulldozer.Size = new Size(206, 23);
|
this.buttonCreateUpgradedBulldozer.Name = "buttonCreateUpgradedBulldozer";
|
||||||
buttonCreateUpgradedBulldozer.TabIndex = 8;
|
this.buttonCreateUpgradedBulldozer.Size = new System.Drawing.Size(235, 31);
|
||||||
buttonCreateUpgradedBulldozer.Text = "Создать бульдозер с обвесами";
|
this.buttonCreateUpgradedBulldozer.TabIndex = 8;
|
||||||
buttonCreateUpgradedBulldozer.UseVisualStyleBackColor = true;
|
this.buttonCreateUpgradedBulldozer.Text = "Создать бульдозер с обвесами";
|
||||||
buttonCreateUpgradedBulldozer.Click += buttonCreateUpgradedBulldozer_Click;
|
this.buttonCreateUpgradedBulldozer.UseVisualStyleBackColor = true;
|
||||||
|
this.buttonCreateUpgradedBulldozer.Click += new System.EventHandler(this.buttonCreateUpgradedBulldozer_Click);
|
||||||
|
//
|
||||||
|
// buttonSelectBulldozer
|
||||||
|
//
|
||||||
|
this.buttonSelectBulldozer.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||||
|
this.buttonSelectBulldozer.Location = new System.Drawing.Point(412, 746);
|
||||||
|
this.buttonSelectBulldozer.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||||
|
this.buttonSelectBulldozer.Name = "buttonSelectBulldozer";
|
||||||
|
this.buttonSelectBulldozer.Size = new System.Drawing.Size(130, 31);
|
||||||
|
this.buttonSelectBulldozer.TabIndex = 9;
|
||||||
|
this.buttonSelectBulldozer.Text = "Выбрать объект";
|
||||||
|
this.buttonSelectBulldozer.UseVisualStyleBackColor = true;
|
||||||
|
this.buttonSelectBulldozer.Click += new System.EventHandler(this.buttonSelectBulldozer_Click);
|
||||||
//
|
//
|
||||||
// FormBulldozer
|
// FormBulldozer
|
||||||
//
|
//
|
||||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
|
||||||
AutoScaleMode = AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
ClientSize = new Size(884, 461);
|
this.ClientSize = new System.Drawing.Size(1110, 793);
|
||||||
Controls.Add(buttonCreateUpgradedBulldozer);
|
this.Controls.Add(this.buttonSelectBulldozer);
|
||||||
Controls.Add(buttonStep);
|
this.Controls.Add(this.buttonCreateUpgradedBulldozer);
|
||||||
Controls.Add(comboBoxStrategy);
|
this.Controls.Add(this.buttonStep);
|
||||||
Controls.Add(buttonUp);
|
this.Controls.Add(this.comboBoxStrategy);
|
||||||
Controls.Add(buttonRight);
|
this.Controls.Add(this.buttonUp);
|
||||||
Controls.Add(buttonDown);
|
this.Controls.Add(this.buttonRight);
|
||||||
Controls.Add(buttonLeft);
|
this.Controls.Add(this.buttonDown);
|
||||||
Controls.Add(buttonCreateBulldozer);
|
this.Controls.Add(this.buttonLeft);
|
||||||
Controls.Add(pictureBoxBulldozer);
|
this.Controls.Add(this.buttonCreateBulldozer);
|
||||||
Name = "FormBulldozer";
|
this.Controls.Add(this.pictureBoxBulldozer);
|
||||||
StartPosition = FormStartPosition.CenterScreen;
|
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||||
Text = "Bulldozer";
|
this.Name = "FormBulldozer";
|
||||||
((System.ComponentModel.ISupportInitialize)pictureBoxBulldozer).EndInit();
|
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||||
ResumeLayout(false);
|
this.Text = "Bulldozer";
|
||||||
PerformLayout();
|
((System.ComponentModel.ISupportInitialize)(this.pictureBoxBulldozer)).EndInit();
|
||||||
|
this.ResumeLayout(false);
|
||||||
|
this.PerformLayout();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@ -179,5 +203,6 @@
|
|||||||
private ComboBox comboBoxStrategy;
|
private ComboBox comboBoxStrategy;
|
||||||
private Button buttonStep;
|
private Button buttonStep;
|
||||||
private Button buttonCreateUpgradedBulldozer;
|
private Button buttonCreateUpgradedBulldozer;
|
||||||
|
private Button buttonSelectBulldozer;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -5,19 +5,34 @@ namespace Bulldozer
|
|||||||
{
|
{
|
||||||
public partial class FormBulldozer : Form
|
public partial class FormBulldozer : Form
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Ïîëå-îáúåêò äëÿ ïðîðèñîâêè îáúåêòà
|
||||||
|
/// </summary>
|
||||||
private DrawingBulldozer? _drawingBulldozer;
|
private DrawingBulldozer? _drawingBulldozer;
|
||||||
|
|
||||||
public FormBulldozer()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Ñòðàòåãèÿ ïåðåìåùåíèÿ
|
/// Ñòðàòåãèÿ ïåðåìåùåíèÿ
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private AbstractStrategy? _abstractStrategy;
|
private AbstractStrategy? _abstractStrategy;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Âûáðàííûé áóëüäîçåð
|
||||||
|
/// </summary>
|
||||||
|
public DrawingBulldozer? SelectedBulldozer { get; private set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Èíèöèàëèçàöèÿ ôîðìû
|
||||||
|
/// </summary>
|
||||||
|
public FormBulldozer()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
_abstractStrategy = null;
|
||||||
|
SelectedBulldozer = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Ìåòîä ïðîðèñîâêè áóëüäîçåðà
|
||||||
|
/// </summary>
|
||||||
private void Draw()
|
private void Draw()
|
||||||
{
|
{
|
||||||
if (_drawingBulldozer == null)
|
if (_drawingBulldozer == null)
|
||||||
@ -35,7 +50,6 @@ namespace Bulldozer
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sender"></param>
|
/// <param name="sender"></param>
|
||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
|
|
||||||
private void ButtonMove_Click(object sender, EventArgs e)
|
private void ButtonMove_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (_drawingBulldozer == null)
|
if (_drawingBulldozer == null)
|
||||||
@ -61,26 +75,58 @@ namespace Bulldozer
|
|||||||
Draw();
|
Draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Îáðàáîòêà íàæàòèÿ êíîïêè "Ñîçäàòü"
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
private void buttonCreateUpgradedBulldozer_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Random random = new Random();
|
||||||
|
Color bodyColor = Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)); // Îñíîâíîé öâåò
|
||||||
|
Color additionalColor = Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256));
|
||||||
|
Color dopColor = Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)); // Äîï. öâåò äëÿ EntityUpgradedBulldozer
|
||||||
|
ColorDialog colorDialog = new();
|
||||||
|
|
||||||
|
if (colorDialog.ShowDialog() == DialogResult.OK)
|
||||||
|
bodyColor = colorDialog.Color;
|
||||||
|
if (colorDialog.ShowDialog() == DialogResult.OK)
|
||||||
|
dopColor = colorDialog.Color;
|
||||||
|
_drawingBulldozer = new DrawingBulldozerUpgraded(
|
||||||
|
random.Next(100, 300), // Ñêîðîñòü
|
||||||
|
random.Next(1000, 3000), // Âåñ
|
||||||
|
bodyColor, additionalColor, dopColor,
|
||||||
|
Convert.ToBoolean(random.Next(2)),
|
||||||
|
Convert.ToBoolean(random.Next(2)),
|
||||||
|
pictureBoxBulldozer.Width,
|
||||||
|
pictureBoxBulldozer.Height
|
||||||
|
);
|
||||||
|
|
||||||
|
_drawingBulldozer.SetPosition(random.Next(10, 100), random.Next(10, 100));
|
||||||
|
Draw();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private void buttonCreateBulldozer_Click(object sender, EventArgs e)
|
private void buttonCreateBulldozer_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Random random = new();
|
Random random = new();
|
||||||
_drawingBulldozer = new DrawingBulldozer(random.Next(100, 300), random.Next(1000, 3000),
|
Color bodyColor = Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256));
|
||||||
Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)),
|
ColorDialog colorDialog = new ColorDialog();
|
||||||
Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)),
|
|
||||||
pictureBoxBulldozer.Width, pictureBoxBulldozer.Height);
|
|
||||||
_drawingBulldozer.SetPosition(random.Next(10, 100), random.Next(10, 100));
|
if (colorDialog.ShowDialog() == DialogResult.OK)
|
||||||
Draw();
|
{
|
||||||
|
bodyColor = colorDialog.Color;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void buttonCreateUpgradedBulldozer_Click(object sender, EventArgs e)
|
Color additionalColor = Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256));
|
||||||
{
|
|
||||||
Random random = new();
|
_drawingBulldozer = new DrawingBulldozer(random.Next(100, 300), // Ñêîðîñòü
|
||||||
_drawingBulldozer = new DrawingBulldozerUpgraded(random.Next(100, 300), random.Next(1000, 3000),
|
random.Next(1000, 3000), // Âåñ
|
||||||
Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)),
|
bodyColor, additionalColor,
|
||||||
Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)),
|
pictureBoxBulldozer.Width,
|
||||||
Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)),
|
pictureBoxBulldozer.Height);
|
||||||
Convert.ToBoolean(random.Next(0, 2)), Convert.ToBoolean(random.Next(0, 2)),
|
|
||||||
pictureBoxBulldozer.Width, pictureBoxBulldozer.Height);
|
|
||||||
_drawingBulldozer.SetPosition(random.Next(10, 100), random.Next(10, 100));
|
_drawingBulldozer.SetPosition(random.Next(10, 100), random.Next(10, 100));
|
||||||
Draw();
|
Draw();
|
||||||
}
|
}
|
||||||
@ -118,5 +164,17 @@ namespace Bulldozer
|
|||||||
_abstractStrategy = null;
|
_abstractStrategy = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Âûáîð áóëüäîçåðà
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
|
||||||
|
private void buttonSelectBulldozer_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
SelectedBulldozer = _drawingBulldozer;
|
||||||
|
DialogResult = DialogResult.OK;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
124
Bulldozer/Bulldozer/FormBulldozerCollection.Designer.cs
generated
Normal file
124
Bulldozer/Bulldozer/FormBulldozerCollection.Designer.cs
generated
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
namespace Bulldozer
|
||||||
|
{
|
||||||
|
partial class FormBulldozerCollection
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Required designer variable.
|
||||||
|
/// </summary>
|
||||||
|
private System.ComponentModel.IContainer components = null;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clean up any resources being used.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
|
protected override void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && (components != null))
|
||||||
|
{
|
||||||
|
components.Dispose();
|
||||||
|
}
|
||||||
|
base.Dispose(disposing);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Windows Form Designer generated code
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Required method for Designer support - do not modify
|
||||||
|
/// the contents of this method with the code editor.
|
||||||
|
/// </summary>
|
||||||
|
private void InitializeComponent()
|
||||||
|
{
|
||||||
|
pictureBoxCollection = new PictureBox();
|
||||||
|
panelTools = new Panel();
|
||||||
|
textBox = new TextBox();
|
||||||
|
buttonUpdateColletion = new Button();
|
||||||
|
buttonDeleteBulldozer = new Button();
|
||||||
|
buttonAddBulldozer = new Button();
|
||||||
|
((System.ComponentModel.ISupportInitialize)pictureBoxCollection).BeginInit();
|
||||||
|
panelTools.SuspendLayout();
|
||||||
|
SuspendLayout();
|
||||||
|
//
|
||||||
|
// pictureBoxCollection
|
||||||
|
//
|
||||||
|
pictureBoxCollection.Anchor = AnchorStyles.Left;
|
||||||
|
pictureBoxCollection.BackColor = SystemColors.Control;
|
||||||
|
pictureBoxCollection.Location = new Point(12, 12);
|
||||||
|
pictureBoxCollection.Name = "pictureBoxCollection";
|
||||||
|
pictureBoxCollection.Size = new Size(711, 571);
|
||||||
|
pictureBoxCollection.TabIndex = 0;
|
||||||
|
pictureBoxCollection.TabStop = false;
|
||||||
|
//
|
||||||
|
// panelTools
|
||||||
|
//
|
||||||
|
panelTools.Controls.Add(textBox);
|
||||||
|
panelTools.Controls.Add(buttonUpdateColletion);
|
||||||
|
panelTools.Controls.Add(buttonDeleteBulldozer);
|
||||||
|
panelTools.Controls.Add(buttonAddBulldozer);
|
||||||
|
panelTools.Location = new Point(729, 12);
|
||||||
|
panelTools.Name = "panelTools";
|
||||||
|
panelTools.Size = new Size(234, 571);
|
||||||
|
panelTools.TabIndex = 1;
|
||||||
|
panelTools.Tag = "";
|
||||||
|
//
|
||||||
|
// textBox
|
||||||
|
//
|
||||||
|
textBox.Location = new Point(23, 164);
|
||||||
|
textBox.Name = "textBox";
|
||||||
|
textBox.Size = new Size(193, 23);
|
||||||
|
textBox.TabIndex = 3;
|
||||||
|
//
|
||||||
|
// buttonUpdateColletion
|
||||||
|
//
|
||||||
|
buttonUpdateColletion.Location = new Point(23, 263);
|
||||||
|
buttonUpdateColletion.Name = "buttonUpdateColletion";
|
||||||
|
buttonUpdateColletion.Size = new Size(193, 40);
|
||||||
|
buttonUpdateColletion.TabIndex = 2;
|
||||||
|
buttonUpdateColletion.Text = "Обновить коллекцию";
|
||||||
|
buttonUpdateColletion.UseVisualStyleBackColor = true;
|
||||||
|
buttonUpdateColletion.Click += ButtonUpdateCollection_Click;
|
||||||
|
//
|
||||||
|
// buttonDeleteBulldozer
|
||||||
|
//
|
||||||
|
buttonDeleteBulldozer.Location = new Point(23, 193);
|
||||||
|
buttonDeleteBulldozer.Name = "buttonDeleteBulldozer";
|
||||||
|
buttonDeleteBulldozer.Size = new Size(193, 40);
|
||||||
|
buttonDeleteBulldozer.TabIndex = 1;
|
||||||
|
buttonDeleteBulldozer.Text = "Удалить объект";
|
||||||
|
buttonDeleteBulldozer.UseVisualStyleBackColor = true;
|
||||||
|
buttonDeleteBulldozer.Click += ButtonDeleteBulldozer_Click;
|
||||||
|
//
|
||||||
|
// buttonAddBulldozer
|
||||||
|
//
|
||||||
|
buttonAddBulldozer.Location = new Point(23, 32);
|
||||||
|
buttonAddBulldozer.Name = "buttonAddBulldozer";
|
||||||
|
buttonAddBulldozer.Size = new Size(193, 40);
|
||||||
|
buttonAddBulldozer.TabIndex = 0;
|
||||||
|
buttonAddBulldozer.Text = "Добавить объект";
|
||||||
|
buttonAddBulldozer.UseVisualStyleBackColor = true;
|
||||||
|
buttonAddBulldozer.Click += ButtonAddBulldozer_Click;
|
||||||
|
//
|
||||||
|
// FormBulldozerCollection
|
||||||
|
//
|
||||||
|
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||||
|
AutoScaleMode = AutoScaleMode.Font;
|
||||||
|
ClientSize = new Size(971, 595);
|
||||||
|
Controls.Add(panelTools);
|
||||||
|
Controls.Add(pictureBoxCollection);
|
||||||
|
Name = "FormBulldozerCollection";
|
||||||
|
Text = "Bulldozer Collection";
|
||||||
|
((System.ComponentModel.ISupportInitialize)pictureBoxCollection).EndInit();
|
||||||
|
panelTools.ResumeLayout(false);
|
||||||
|
panelTools.PerformLayout();
|
||||||
|
ResumeLayout(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
private PictureBox pictureBoxCollection;
|
||||||
|
private Panel panelTools;
|
||||||
|
private TextBox textBox;
|
||||||
|
private Button buttonUpdateColletion;
|
||||||
|
private Button buttonDeleteBulldozer;
|
||||||
|
private Button buttonAddBulldozer;
|
||||||
|
}
|
||||||
|
}
|
60
Bulldozer/Bulldozer/FormBulldozerCollection.cs
Normal file
60
Bulldozer/Bulldozer/FormBulldozerCollection.cs
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
using Bulldozer.DrawingObjects;
|
||||||
|
using Bulldozer.Generics;
|
||||||
|
using Bulldozer.MovementStrategy;
|
||||||
|
|
||||||
|
|
||||||
|
namespace Bulldozer
|
||||||
|
{
|
||||||
|
public partial class FormBulldozerCollection : Form
|
||||||
|
{
|
||||||
|
private readonly BulldozersGenericCollection<DrawingBulldozer, DrawingObjectBulldozer> _bulldozers;
|
||||||
|
public FormBulldozerCollection()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
_bulldozers = new BulldozersGenericCollection<DrawingBulldozer,
|
||||||
|
DrawingObjectBulldozer>(pictureBoxCollection.Width, pictureBoxCollection.Height);
|
||||||
|
|
||||||
|
}
|
||||||
|
private void ButtonAddBulldozer_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
FormBulldozer form = new();
|
||||||
|
if (form.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
if (_bulldozers + form.SelectedBulldozer != null)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Объект добавлен");
|
||||||
|
pictureBoxCollection.Image = _bulldozers.ShowBulldozers();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show("Не удалось добавить объект");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonDeleteBulldozer_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (MessageBox.Show("Удалить объект?", "Удаление", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
|
||||||
|
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
int pos = Convert.ToInt32(textBox.Text);
|
||||||
|
if (_bulldozers - pos != null)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Объект удален");
|
||||||
|
pictureBoxCollection.Image = _bulldozers.ShowBulldozers();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MessageBox.Show("Не удалось удалить объект");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ButtonUpdateCollection_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
pictureBoxCollection.Image = _bulldozers.ShowBulldozers();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
120
Bulldozer/Bulldozer/FormBulldozerCollection.resx
Normal file
120
Bulldozer/Bulldozer/FormBulldozerCollection.resx
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
</root>
|
129
Bulldozer/Bulldozer/Generics/BulldozersGenericCollection.cs
Normal file
129
Bulldozer/Bulldozer/Generics/BulldozersGenericCollection.cs
Normal file
@ -0,0 +1,129 @@
|
|||||||
|
using Bulldozer.DrawingObjects;
|
||||||
|
using Bulldozer.MovementStrategy;
|
||||||
|
|
||||||
|
namespace Bulldozer.Generics
|
||||||
|
{
|
||||||
|
internal class BulldozersGenericCollection<T, U>
|
||||||
|
where T : DrawingBulldozer
|
||||||
|
where U : IMoveableObject
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Ширина окна прорисовки
|
||||||
|
/// </summary>
|
||||||
|
private readonly int _pictureWidth;
|
||||||
|
/// <summary>
|
||||||
|
/// Высота окна прорисовки
|
||||||
|
/// </summary>
|
||||||
|
private readonly int _pictureHeight;
|
||||||
|
/// <summary>
|
||||||
|
/// Размер занимаемого объектом места (ширина)
|
||||||
|
/// </summary>
|
||||||
|
private readonly int _placeSizeWidth = 300;
|
||||||
|
/// <summary>
|
||||||
|
/// Размер занимаемого объектом места (высота)
|
||||||
|
/// </summary>
|
||||||
|
private readonly int _placeSizeHeight = 70;
|
||||||
|
/// <summary>
|
||||||
|
/// Набор объектов
|
||||||
|
/// </summary>
|
||||||
|
private readonly SetGeneric<T> _collection;
|
||||||
|
/// <summary>
|
||||||
|
/// Конструктор
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="picWidth"></param>
|
||||||
|
/// <param name="picHeight"></param>
|
||||||
|
public BulldozersGenericCollection(int picWidth, int picHeight)
|
||||||
|
{
|
||||||
|
int width = picWidth / _placeSizeWidth;
|
||||||
|
int height = picHeight / _placeSizeHeight;
|
||||||
|
_pictureWidth = picWidth;
|
||||||
|
_pictureHeight = picHeight;
|
||||||
|
_collection = new SetGeneric<T>(width * height);
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Перегрузка оператора сложения
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="collect"></param>
|
||||||
|
/// <param name="obj"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static int operator +(BulldozersGenericCollection<T, U> collect, T? obj)
|
||||||
|
{
|
||||||
|
if (obj == null)
|
||||||
|
return -1;
|
||||||
|
return collect?._collection.Insert(obj) ?? -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool operator -(BulldozersGenericCollection<T, U> collect, int
|
||||||
|
pos)
|
||||||
|
{
|
||||||
|
T? obj = collect._collection.Get(pos);
|
||||||
|
if (obj != null)
|
||||||
|
return collect._collection.Remove(pos);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Получение объекта IMoveableObject
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pos"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public U? GetU(int pos)
|
||||||
|
{
|
||||||
|
return (U?)_collection.Get(pos)?.GetMoveableObject;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Вывод всего набора объектов
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public Bitmap ShowBulldozers()
|
||||||
|
{
|
||||||
|
Bitmap bmp = new(_pictureWidth, _pictureHeight);
|
||||||
|
Graphics gr = Graphics.FromImage(bmp);
|
||||||
|
DrawBackground(gr);
|
||||||
|
DrawObjects(gr);
|
||||||
|
return bmp;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Метод отрисовки фона
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="g"></param>
|
||||||
|
private void DrawBackground(Graphics g)
|
||||||
|
{
|
||||||
|
Pen pen = new(Color.Black, 3);
|
||||||
|
for (int i = 0; i < _pictureWidth / _placeSizeWidth; i++)
|
||||||
|
{
|
||||||
|
for (int j = 0; j < _pictureHeight / _placeSizeHeight +
|
||||||
|
1; ++j)
|
||||||
|
{
|
||||||
|
g.DrawLine(pen, i * _placeSizeWidth, j *
|
||||||
|
_placeSizeHeight, i * _placeSizeWidth + _placeSizeWidth / 2, j *
|
||||||
|
_placeSizeHeight);
|
||||||
|
}
|
||||||
|
g.DrawLine(pen, i * _placeSizeWidth, 0, i *
|
||||||
|
_placeSizeWidth, _pictureHeight / _placeSizeHeight * _placeSizeHeight);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Метод прорисовки объектов
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="g"></param>
|
||||||
|
private void DrawObjects(Graphics g)
|
||||||
|
{
|
||||||
|
int heightObjCount = _pictureHeight / _placeSizeHeight;
|
||||||
|
int widthObjCount = _pictureWidth / _placeSizeWidth;
|
||||||
|
int totalObjects = _collection.Count;
|
||||||
|
|
||||||
|
for (int i = 0; i < totalObjects; i++)
|
||||||
|
{
|
||||||
|
T? type = _collection.Get(i);
|
||||||
|
if (type != null)
|
||||||
|
{
|
||||||
|
int col = widthObjCount - 1 - (i % widthObjCount);
|
||||||
|
int row = heightObjCount - 1 - (i / widthObjCount);
|
||||||
|
|
||||||
|
type.SetPosition(col * _placeSizeWidth, row * _placeSizeHeight);
|
||||||
|
type?.DrawBulldozer(g);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
87
Bulldozer/Bulldozer/Generics/SetGeneric.cs
Normal file
87
Bulldozer/Bulldozer/Generics/SetGeneric.cs
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
namespace Bulldozer.Generics
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Параметризованный набор объектов
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="T"></typeparam>
|
||||||
|
internal class SetGeneric<T>
|
||||||
|
where T : class
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Массив объектов, которые храним
|
||||||
|
/// </summary>
|
||||||
|
private readonly T?[] _places;
|
||||||
|
/// <summary>
|
||||||
|
/// Количество объектов в массиве
|
||||||
|
/// </summary>
|
||||||
|
public int Count => _places.Length;
|
||||||
|
/// <summary>
|
||||||
|
/// Конструктор
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="count"></param>
|
||||||
|
public SetGeneric(int count)
|
||||||
|
{
|
||||||
|
_places = new T?[count];
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Добавление объекта в набор
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="bulldozer">Добавляемый автомобиль</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public int Insert(T bulldozer)
|
||||||
|
{
|
||||||
|
if (_places[Count - 1] != null)
|
||||||
|
return -1;
|
||||||
|
return Insert(bulldozer, 0);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Добавление объекта в набор на конкретную позицию
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="bulldozer">Добавляемый автомобиль</param>
|
||||||
|
/// <param name="position">Позиция</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public int Insert(T bulldozer, int position)
|
||||||
|
{
|
||||||
|
if (!(position >= 0 && position < Count))
|
||||||
|
return -1;
|
||||||
|
if (_places[position] != null)
|
||||||
|
{
|
||||||
|
int ind = position;
|
||||||
|
while (ind < Count && _places[ind] != null)
|
||||||
|
ind++;
|
||||||
|
if (ind == Count)
|
||||||
|
return -1;
|
||||||
|
for (int i = ind - 1; i >= position; i--)
|
||||||
|
_places[i + 1] = _places[i];
|
||||||
|
}
|
||||||
|
_places[position] = bulldozer;
|
||||||
|
return position;
|
||||||
|
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Удаление объекта из набора с конкретной позиции
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="position"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool Remove(int position)
|
||||||
|
{
|
||||||
|
if (!(position >= 0 && position < Count) || _places[position] == null)
|
||||||
|
return false;
|
||||||
|
_places[position] = null;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// Получение объекта из набора по позиции
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="position"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public T? Get(int position)
|
||||||
|
{
|
||||||
|
if (!(position >= 0 && position < Count))
|
||||||
|
return null;
|
||||||
|
return _places[position];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,5 +1,6 @@
|
|||||||
using Bulldozer.DrawingObjects;
|
using Bulldozer.DrawingObjects;
|
||||||
|
|
||||||
|
|
||||||
namespace Bulldozer.MovementStrategy
|
namespace Bulldozer.MovementStrategy
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -12,10 +12,10 @@ namespace Bulldozer.MovementStrategy
|
|||||||
var objParams = GetObjectParameters;
|
var objParams = GetObjectParameters;
|
||||||
|
|
||||||
return objParams != null
|
return objParams != null
|
||||||
&& objParams.RightBorder <= FieldWidth
|
&& objParams.ObjectMiddleHorizontal >= FieldWidth
|
||||||
&& objParams.RightBorder + GetStep() >= FieldWidth
|
&& objParams.ObjectMiddleHorizontal - GetStep() <= FieldWidth
|
||||||
&& objParams.TopBorder <= FieldHeight
|
&& objParams.ObjectMiddleVertical >= FieldHeight
|
||||||
&& objParams.DownBorder + GetStep() >= FieldHeight;
|
&& objParams.ObjectMiddleVertical - GetStep() <= FieldHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void MoveToTarget()
|
protected override void MoveToTarget()
|
||||||
@ -26,8 +26,8 @@ namespace Bulldozer.MovementStrategy
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var diffX = objParams.RightBorder - FieldWidth;
|
var diffX = objParams.ObjectMiddleHorizontal - FieldWidth;
|
||||||
var diffY = objParams.DownBorder - FieldHeight;
|
var diffY = objParams.ObjectMiddleVertical - FieldHeight;
|
||||||
|
|
||||||
if (Math.Abs(diffX) > GetStep())
|
if (Math.Abs(diffX) > GetStep())
|
||||||
{
|
{
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Нижняя граница
|
/// Нижняя граница
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
//public int DownBorder => _y + _height;
|
||||||
public int DownBorder => _y + _height;
|
public int DownBorder => _y + _height;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Середина объекта
|
/// Середина объекта
|
||||||
|
@ -9,7 +9,7 @@ namespace Bulldozer.MovementStrategy
|
|||||||
static void Main()
|
static void Main()
|
||||||
{
|
{
|
||||||
ApplicationConfiguration.Initialize();
|
ApplicationConfiguration.Initialize();
|
||||||
Application.Run(new FormBulldozer());
|
Application.Run(new FormBulldozerCollection());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user