PIbd-23 Firsov Kirill LabWork 03 #8

Closed
Firsov_Kirill wants to merge 6 commits from Laba3 into Laba2
4 changed files with 11 additions and 11 deletions
Showing only changes of commit 65e6415db6 - Show all commits

View File

@ -81,7 +81,7 @@ namespace ProjectTractor.DrawningObjects {
}
/// <summary>
/// Получение объекта IMoveableObject из объекта DrawningCar
/// Получение объекта IMoveableObject из объекта DrawningTractor
/// </summary>
public IMoveableObject GetMoveableObject => new
DrawningObjectTractor(this);

View File

@ -20,14 +20,14 @@ namespace ProjectTractor
/// Набор объектов
/// </summary>
private readonly TractorsGenericCollection<DrawningTractor,
DrawningObjectTractor> _cars;
DrawningObjectTractor> _tractors;
/// <summary>
/// Конструктор
/// </summary>
public FormTractorCollection()
{
InitializeComponent();
_cars = new TractorsGenericCollection<DrawningTractor,
_tractors = new TractorsGenericCollection<DrawningTractor,
DrawningObjectTractor>(pictureBoxCollection.Width, pictureBoxCollection.Height);
}
@ -36,10 +36,10 @@ namespace ProjectTractor
FormTractor form = new();
if (form.ShowDialog() == DialogResult.OK)
{
if (_cars + form.SelectedTractor)
if (_tractors + form.SelectedTractor)
{
MessageBox.Show("Объект добавлен");
pictureBoxCollection.Image = _cars.ShowCars();
pictureBoxCollection.Image = _tractors.ShowTractors();
}
else
{
@ -61,10 +61,10 @@ namespace ProjectTractor
return;
}
int pos = Convert.ToInt32(maskedTextBoxNumber.Text);
if (_cars - pos)
if (_tractors - pos)
{
MessageBox.Show("Объект удален");
pictureBoxCollection.Image = _cars.ShowCars();
pictureBoxCollection.Image = _tractors.ShowTractors();
}
else
{
@ -79,7 +79,7 @@ namespace ProjectTractor
private void ButtonRefreshCollection_Click(object sender, EventArgs
e)
{
pictureBoxCollection.Image = _cars.ShowCars();
pictureBoxCollection.Image = _tractors.ShowTractors();
}
private void InitializeComponent()

View File

@ -45,7 +45,7 @@ namespace ProjectTractor.Generics
/// <summary>
/// Добавление объекта в набор на конкретную позицию
/// </summary>
/// <param name="car">Добавляемый автомобиль</param>
/// <param name="tractor">Добавляемый трактор</param>
/// <param name="position">Позиция</param>
/// <returns></returns>
public bool Insert(T tractor, int position)

View File

@ -9,7 +9,7 @@ using ProjectTractor.MovementStrategy;
namespace ProjectTractor.Generics
{
/// <summary>
/// Параметризованный класс для набора объектов DrawningCar
/// Параметризованный класс для набора объектов DrawningTractor
/// </summary>
/// <typeparam name="T"></typeparam>
/// <typeparam name="U"></typeparam>
@ -93,7 +93,7 @@ namespace ProjectTractor.Generics
/// Вывод всего набора объектов
/// </summary>
/// <returns></returns>
public Bitmap ShowCars()
public Bitmap ShowTractors()
{
Bitmap bmp = new(_pictureWidth, _pictureHeight);
Graphics gr = Graphics.FromImage(bmp);