diff --git a/DoubleDeckerBus/DoubleDeckerBus/CollectionGenericObjects/AbstractCompany.cs b/DoubleDeckerBus/DoubleDeckerBus/CollectionGenericObjects/AbstractCompany.cs
index f55bf5a..6693ce4 100644
--- a/DoubleDeckerBus/DoubleDeckerBus/CollectionGenericObjects/AbstractCompany.cs
+++ b/DoubleDeckerBus/DoubleDeckerBus/CollectionGenericObjects/AbstractCompany.cs
@@ -17,7 +17,7 @@ public abstract class AbstractCompany
///
/// Размер места(ширина)
///
- protected readonly int _placeSizeWidth = 210;
+ protected readonly int _placeSizeWidth = 130;
///
/// Размер места(высота)
diff --git a/DoubleDeckerBus/DoubleDeckerBus/CollectionGenericObjects/BusStation.cs b/DoubleDeckerBus/DoubleDeckerBus/CollectionGenericObjects/BusStation.cs
index 6027ca1..3e598d3 100644
--- a/DoubleDeckerBus/DoubleDeckerBus/CollectionGenericObjects/BusStation.cs
+++ b/DoubleDeckerBus/DoubleDeckerBus/CollectionGenericObjects/BusStation.cs
@@ -9,17 +9,54 @@ namespace DoubleDeckerBus.CollectionGenericObjects;
public class BusStation : AbstractCompany
{
+
+ private int[]? _arrayOfCoordinates;
+
public BusStation(int picWidth, int picHeight, ICollectionGenericObjects collection) : base(picWidth, picHeight, collection)
{
}
protected override void DrawBackground(Graphics g)
{
- throw new NotImplementedException();
+ Pen pen = new Pen(Color.Black, 3);
+
+ int gap = 15;
+ int y = 10;
+ int size_of_array = 2;
+
+ while (y + _placeSizeHeight < _pictureHeight - gap)
+ {
+ int x = _pictureWidth - gap;
+
+ while (x - _placeSizeWidth > gap)
+ {
+ g.DrawLine(pen, x, y, x - _placeSizeWidth, y);
+ g.DrawLine(pen, x, y, x, y + _placeSizeHeight);
+ g.DrawLine(pen, x, y + _placeSizeHeight, x - _placeSizeWidth, y + _placeSizeHeight);
+
+ Array.Resize(ref _arrayOfCoordinates, size_of_array);
+ _arrayOfCoordinates[size_of_array - 2] = x;
+ _arrayOfCoordinates[size_of_array - 1] = y;
+
+ x -= (_placeSizeWidth + 70);
+ }
+ y += _placeSizeHeight;
+ size_of_array += 2;
+ }
}
protected override void SetObjectsPosition()
{
- throw new NotImplementedException();
+ if (_arrayOfCoordinates == null || _collection == null)
+ {
+ return;
+ }
+
+ for (int i = 0, coordinate_index = 0; i < _collection.Count; i++, coordinate_index += 2)
+ {
+ _collection.Get(i)?.SetPictureSize(_pictureWidth, _pictureHeight);
+ _collection.Get(i)?.SetPosition(_arrayOfCoordinates[coordinate_index], _arrayOfCoordinates[coordinate_index + 1]);
+
+ }
}
}
diff --git a/DoubleDeckerBus/DoubleDeckerBus/FormBusCollection.Designer.cs b/DoubleDeckerBus/DoubleDeckerBus/FormBusCollection.Designer.cs
index dececd8..0bef3a8 100644
--- a/DoubleDeckerBus/DoubleDeckerBus/FormBusCollection.Designer.cs
+++ b/DoubleDeckerBus/DoubleDeckerBus/FormBusCollection.Designer.cs
@@ -51,7 +51,7 @@
groupBoxTools.Controls.Add(buttonAddBus);
groupBoxTools.Controls.Add(comboBoxSelectCompany);
groupBoxTools.Dock = DockStyle.Right;
- groupBoxTools.Location = new Point(600, 0);
+ groupBoxTools.Location = new Point(870, 0);
groupBoxTools.Name = "groupBoxTools";
groupBoxTools.Size = new Size(200, 450);
groupBoxTools.TabIndex = 0;
@@ -138,7 +138,7 @@
pictureBox.Dock = DockStyle.Fill;
pictureBox.Location = new Point(0, 0);
pictureBox.Name = "pictureBox";
- pictureBox.Size = new Size(600, 450);
+ pictureBox.Size = new Size(870, 450);
pictureBox.TabIndex = 1;
pictureBox.TabStop = false;
//
@@ -146,7 +146,7 @@
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
- ClientSize = new Size(800, 450);
+ ClientSize = new Size(1070, 450);
Controls.Add(pictureBox);
Controls.Add(groupBoxTools);
Name = "FormBusCollection";