This commit is contained in:
parent 7de3fe8c3c
commit 1b3e1d0826
6 changed files with 0 additions and 80 deletions

View File

@ -38,10 +38,7 @@
comboBoxStrategy = new ComboBox();
buttonCreateBus = new Button();
buttonStep = new Button();
<<<<<<< HEAD
buttonSelectBus = new Button();
=======
>>>>>>> 82f43f1c079e24d5df9441679bb15b3e230ddbee
((System.ComponentModel.ISupportInitialize)pictureBoxAccordionBus).BeginInit();
SuspendLayout();
//
@ -148,7 +145,6 @@
buttonStep.UseVisualStyleBackColor = true;
buttonStep.Click += buttonStep_Click;
//
<<<<<<< HEAD
// buttonSelectBus
//
buttonSelectBus.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
@ -162,17 +158,12 @@
buttonSelectBus.UseVisualStyleBackColor = true;
buttonSelectBus.Click += buttonSelectBus_Click;
//
=======
>>>>>>> 82f43f1c079e24d5df9441679bb15b3e230ddbee
// AccordionBusForm
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(884, 461);
<<<<<<< HEAD
Controls.Add(buttonSelectBus);
=======
>>>>>>> 82f43f1c079e24d5df9441679bb15b3e230ddbee
Controls.Add(buttonStep);
Controls.Add(buttonCreateBus);
Controls.Add(comboBoxStrategy);
@ -198,9 +189,6 @@
private ComboBox comboBoxStrategy;
private Button buttonCreateBus;
private Button buttonStep;
<<<<<<< HEAD
private Button buttonSelectBus;
=======
>>>>>>> 82f43f1c079e24d5df9441679bb15b3e230ddbee
}
}

View File

@ -19,14 +19,11 @@ namespace AccordionBus
/// Ñòðàòåãèÿ ïåðåìåùåíèÿ
/// </summary>
private AbstractStrategy? _abstractStrategy;
<<<<<<< HEAD
/// <summary>
/// Âûáðàííûé àâòîáóñ
/// </summary>
public DrawingBus? SelectedBus { get; private set; }
=======
>>>>>>> 82f43f1c079e24d5df9441679bb15b3e230ddbee
/// <summary>
/// Èíèöèàëèçàöèÿ ôîðìû
@ -62,7 +59,6 @@ namespace AccordionBus
/// <param name="e"></param>
private void buttonCreateAccordionBus_Click(object sender, EventArgs e)
{
<<<<<<< HEAD
Random random = new();
// Âûáîð îñíîâíîãî öâåòà
@ -81,9 +77,6 @@ namespace AccordionBus
additionalColor = dialog.Color;
}
=======
Random random = new Random();
>>>>>>> 82f43f1c079e24d5df9441679bb15b3e230ddbee
_drawingBus = new DrawingAccordionBus(random.Next(100, 300),
random.Next(1000, 3000),
bodyColor,
@ -105,7 +98,6 @@ namespace AccordionBus
/// <param name="e"></param>
private void buttonCreateBus_Click(object sender, EventArgs e)
{
<<<<<<< HEAD
Random random = new();
// Âûáîð îñíîâíîãî öâåòà
@ -119,12 +111,6 @@ namespace AccordionBus
_drawingBus = new DrawingBus(random.Next(100, 300),
random.Next(1000, 3000),
bodyColor,
=======
Random random = new Random();
_drawingBus = new DrawingBus(random.Next(100, 300),
random.Next(1000, 3000),
Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)),
>>>>>>> 82f43f1c079e24d5df9441679bb15b3e230ddbee
pictureBoxAccordionBus.Width,
pictureBoxAccordionBus.Height);
@ -209,7 +195,6 @@ namespace AccordionBus
_abstractStrategy = null;
}
}
<<<<<<< HEAD
/// <summary>
/// Âûáîð àâòîáóñà
@ -221,7 +206,5 @@ namespace AccordionBus
SelectedBus = _drawingBus;
DialogResult = DialogResult.OK;
}
=======
>>>>>>> 82f43f1c079e24d5df9441679bb15b3e230ddbee
}
}

View File

@ -4,10 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AccordionBus.Entities;
<<<<<<< HEAD
using AccordionBus.MovementStrategy;
=======
>>>>>>> 82f43f1c079e24d5df9441679bb15b3e230ddbee
namespace AccordionBus.Drawings
{
@ -69,16 +66,12 @@ namespace AccordionBus.Drawings
/// <summary>
/// Высота объекта
/// </summary>
<<<<<<< HEAD
public int GetHeight => _busHeight;
/// <summary>
/// Получение объекта IMoveableObject из объекта DrawningCar
/// </summary>
public IMoveableObject GetMoveableObject => new DrawingObjectBus(this);
=======
public int GetHeigth => _busHeight;
>>>>>>> 82f43f1c079e24d5df9441679bb15b3e230ddbee
/// <summary>
/// Проверка, что объект может перемещаться по указанному направлению
@ -116,7 +109,6 @@ namespace AccordionBus.Drawings
/// <param name="height">Высота картинки</param>
public DrawingBus(int speed, int weight, Color bodyColor, int width, int height)
{
<<<<<<< HEAD
// Проверка на вместимость объекта в размеры картинки
if ((_busWidth >= width) || (_busHeight >= height))
{
@ -126,18 +118,6 @@ namespace AccordionBus.Drawings
_pictureWidth = width;
_pictureHeight = height;
EntityBus = new EntityBus(speed, weight, bodyColor);
=======
_pictureWidth = width;
_pictureHeight = height;
EntityBus = new EntityBus(speed, weight, bodyColor);
// Проверка на вместимость объекта в размеры картинки
if ((_busWidth >= _pictureWidth) || (_busHeight >= _pictureHeight))
{
Console.WriteLine("Ошибка! Нельзя создать рбъект такого размера!");
return;
}
>>>>>>> 82f43f1c079e24d5df9441679bb15b3e230ddbee
}
/// <summary>
@ -152,30 +132,17 @@ namespace AccordionBus.Drawings
/// <param name="busHeight">Выоста прорисовки автобуса</param>
protected DrawingBus(int speed, double weight, Color bodyColor, int width, int height, int busWidth, int busHeight)
{
<<<<<<< HEAD
// Проверка на вместимость объекта в размеры картинки
if ((_busWidth >= width) || (_busHeight >= height))
{
return;
}
=======
>>>>>>> 82f43f1c079e24d5df9441679bb15b3e230ddbee
_pictureWidth = width;
_pictureHeight = height;
_busWidth = busWidth;
_busHeight = busHeight;
EntityBus = new EntityBus(speed, weight, bodyColor);
<<<<<<< HEAD
=======
// Проверка на вместимость объекта в размеры картинки
if ((_busWidth >= _pictureWidth) || (_busHeight >= _pictureHeight))
{
Console.WriteLine("Ошибка! Нельзя создать рбъект такого размера!");
return;
}
>>>>>>> 82f43f1c079e24d5df9441679bb15b3e230ddbee
}
/// <summary>
@ -185,16 +152,12 @@ namespace AccordionBus.Drawings
/// <param name="y">Координата Y</param>
public void SetPosition(int x, int y)
{
<<<<<<< HEAD
if (x < 0 || y < 0)
{
_startPosX = 0;
_startPosY = 0;
}
else if ((x + _busWidth > _pictureWidth) || (y + _busHeight > _pictureHeight))
=======
if ((x + _busWidth > _pictureWidth) || (y + _busHeight > _pictureHeight))
>>>>>>> 82f43f1c079e24d5df9441679bb15b3e230ddbee
{
_startPosX = _pictureWidth - _busWidth;
_startPosY = _pictureHeight - _busHeight;

View File

@ -27,11 +27,7 @@ namespace AccordionBus.MovementStrategy
{
return null;
}
<<<<<<< HEAD
return new ObjectParameters(_drawingBus.GetPosX, _drawingBus.GetPosY, _drawingBus.GetWidth, _drawingBus.GetHeight);
=======
return new ObjectParameters(_drawingBus.GetPosX, _drawingBus.GetPosY, _drawingBus.GetWidth, _drawingBus.GetHeigth);
>>>>>>> 82f43f1c079e24d5df9441679bb15b3e230ddbee
}
}

View File

@ -11,11 +11,7 @@ namespace AccordionBus.MovementStrategy
/// <summary>
/// Интерфейс для работы с перемещаемым объектом
/// </summary>
<<<<<<< HEAD
public interface IMoveableObject
=======
internal interface IMoveableObject
>>>>>>> 82f43f1c079e24d5df9441679bb15b3e230ddbee
{
/// <summary>
/// Получение координаты X объекта

View File

@ -7,15 +7,9 @@ using System.Threading.Tasks;
namespace AccordionBus.MovementStrategy
{
/// <summary>
<<<<<<< HEAD
/// Параметры-координаты объекта
/// </summary>
public class ObjectParameters
=======
/// Параметры-координаты рбъекта
/// </summary>
internal class ObjectParameters
>>>>>>> 82f43f1c079e24d5df9441679bb15b3e230ddbee
{
private readonly int _x;
private readonly int _y;