Внесение небольших правок. Сдана работа.
This commit is contained in:
parent
16b6400b36
commit
ef93a0293c
@ -119,13 +119,9 @@ namespace ProjectBulldozer.Drawning
|
||||
}
|
||||
return direction switch
|
||||
{
|
||||
//влево
|
||||
DirectionType.Left => _startPosX - EntityTractor.Step > 0,
|
||||
//вверх
|
||||
DirectionType.Up => _startPosY - EntityTractor.Step > 0,
|
||||
// вправо
|
||||
DirectionType.Right => _startPosX + EntityTractor.Step < _pictureWidth,
|
||||
//вниз
|
||||
DirectionType.Down => _startPosY + EntityTractor.Step < _pictureHeight,
|
||||
};
|
||||
}
|
||||
|
22
ProjectBulldozer/FormBulldozer.Designer.cs
generated
22
ProjectBulldozer/FormBulldozer.Designer.cs
generated
@ -1,27 +1,8 @@
|
||||
|
||||
namespace Bulldozer
|
||||
namespace Bulldozer
|
||||
{
|
||||
partial class FormBulldozer
|
||||
{
|
||||
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()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormBulldozer));
|
||||
@ -185,7 +166,6 @@ namespace Bulldozer
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
#endregion
|
||||
private PictureBox pictureBoxBulldozer;
|
||||
private Button buttonCreateBulldozer;
|
||||
private Button buttonLeft;
|
||||
|
@ -31,7 +31,6 @@ namespace ProjectBulldozer
|
||||
listBoxStorage.SelectedIndex = index;
|
||||
}
|
||||
}
|
||||
|
||||
private void ButtonAddObject_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(textBoxStorageName.Text))
|
||||
@ -42,12 +41,10 @@ namespace ProjectBulldozer
|
||||
_storage.AddSet(textBoxStorageName.Text);
|
||||
ReloadObjects();
|
||||
}
|
||||
|
||||
private void listBoxStorage_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
pictureBoxCollections.Image = _storage[listBoxStorage.SelectedItem?.ToString() ?? string.Empty]?.ShowTractors();
|
||||
}
|
||||
|
||||
private void ButtonRemoveObject_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (listBoxStorage.SelectedIndex == -1)
|
||||
@ -118,9 +115,5 @@ namespace ProjectBulldozer
|
||||
MessageBox.Show("Не удалось удалить объект");
|
||||
}
|
||||
}
|
||||
private void textBoxStorageName_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
3
ProjectBulldozer/FormBulldozerConfig.Designer.cs
generated
3
ProjectBulldozer/FormBulldozerConfig.Designer.cs
generated
@ -1,5 +1,4 @@
|
||||
|
||||
namespace Bulldozer
|
||||
namespace Bulldozer
|
||||
{
|
||||
partial class FormBulldozerConfig
|
||||
{
|
||||
|
@ -1,6 +1,5 @@
|
||||
using ProjectBulldozer.Drawning;
|
||||
using ProjectBulldozer.Entities;
|
||||
|
||||
namespace Bulldozer
|
||||
{
|
||||
public partial class FormBulldozerConfig : Form
|
||||
@ -115,7 +114,6 @@ namespace Bulldozer
|
||||
{
|
||||
EventAddTractor?.Invoke(obj: _tractor);
|
||||
Close();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,9 @@
|
||||
using Bulldozer;
|
||||
using ProjectBulldozer.MovementStrategy;
|
||||
using ProjectBulldozer.MovementStrategy;
|
||||
namespace ProjectBulldozer.Drawning
|
||||
{
|
||||
public class DrawingObjectTractor : IMoveableObject
|
||||
{
|
||||
private readonly DrawingTractor? _drawningTractor = null;
|
||||
|
||||
public DrawingObjectTractor(DrawingTractor drawningTractor)
|
||||
{
|
||||
_drawningTractor = drawningTractor;
|
||||
|
@ -6,17 +6,9 @@
|
||||
private readonly int _y;
|
||||
private readonly int _width;
|
||||
private readonly int _height;
|
||||
/// Левая граница
|
||||
public int LeftBorder => _x;
|
||||
/// Верхняя граница
|
||||
public int TopBorder => _y;
|
||||
/// Правая граница
|
||||
public int RightBorder => _x + _width;
|
||||
/// Нижняя граница
|
||||
public int DownBorder => _y + _height;
|
||||
/// Середина объекта по горизонтали
|
||||
public int ObjectMiddleHorizontal => _x + _width / 2;
|
||||
/// Середина объекта по вертикали
|
||||
public int ObjectMiddleVertical => _y + _height / 2;
|
||||
public ObjectParameters(int x, int y, int width, int height)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user