diff --git a/ProjectMachine/ProjectMachine/Direction.cs b/ProjectMachine/ProjectMachine/Direction.cs
index 9688957..e667584 100644
--- a/ProjectMachine/ProjectMachine/Direction.cs
+++ b/ProjectMachine/ProjectMachine/Direction.cs
@@ -9,7 +9,7 @@ namespace ProjectMachine
///
/// Направление перемещения
///
- internal enum Direction
+ public enum Direction
{
None = 0,
Up = 1,
diff --git a/ProjectMachine/ProjectMachine/DrawningMachine.cs b/ProjectMachine/ProjectMachine/DrawningMachine.cs
index b7ab6f2..be8ed7e 100644
--- a/ProjectMachine/ProjectMachine/DrawningMachine.cs
+++ b/ProjectMachine/ProjectMachine/DrawningMachine.cs
@@ -9,7 +9,7 @@ namespace ProjectMachine
///
/// Класс, отвечающий за прорисовку и перемещение объекта-сущности
///
- internal class DrawningMachine
+ public class DrawningMachine
{
///
/// Класс-сущность
diff --git a/ProjectMachine/ProjectMachine/EntityMachine.cs b/ProjectMachine/ProjectMachine/EntityMachine.cs
index d3266a0..90e8aee 100644
--- a/ProjectMachine/ProjectMachine/EntityMachine.cs
+++ b/ProjectMachine/ProjectMachine/EntityMachine.cs
@@ -9,7 +9,7 @@ namespace ProjectMachine
///
/// Класс-сущность "Бронированная машина"
///
- internal class EntityMachine
+ public class EntityMachine
{
///
/// Скорость
diff --git a/ProjectMachine/ProjectMachine/FormMachine.Designer.cs b/ProjectMachine/ProjectMachine/FormMachine.Designer.cs
index f7e8390..c89e945 100644
--- a/ProjectMachine/ProjectMachine/FormMachine.Designer.cs
+++ b/ProjectMachine/ProjectMachine/FormMachine.Designer.cs
@@ -39,6 +39,7 @@
this.buttonUp = new System.Windows.Forms.Button();
this.buttonLeft = new System.Windows.Forms.Button();
this.buttonCreateModif = new System.Windows.Forms.Button();
+ this.buttonSelectTank = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxMachine)).BeginInit();
this.statusStrip1.SuspendLayout();
this.SuspendLayout();
@@ -159,11 +160,21 @@
this.buttonCreateModif.UseVisualStyleBackColor = true;
this.buttonCreateModif.Click += new System.EventHandler(this.ButtonCreateModif_Click);
//
+ // buttonSelectTank
+ //
+ this.buttonSelectTank.Location = new System.Drawing.Point(515, 385);
+ this.buttonSelectTank.Name = "buttonSelectTank";
+ this.buttonSelectTank.Size = new System.Drawing.Size(94, 29);
+ this.buttonSelectTank.TabIndex = 8;
+ this.buttonSelectTank.Text = "Выбрать";
+ this.buttonSelectTank.UseVisualStyleBackColor = true;
+ //
// FormMachine
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(733, 453);
+ this.Controls.Add(this.buttonSelectTank);
this.Controls.Add(this.buttonCreateModif);
this.Controls.Add(this.buttonLeft);
this.Controls.Add(this.buttonUp);
@@ -195,5 +206,6 @@
private Button buttonUp;
private Button buttonLeft;
private Button buttonCreateModif;
+ private Button buttonSelectTank;
}
}
\ No newline at end of file
diff --git a/ProjectMachine/ProjectMachine/FormMachine.cs b/ProjectMachine/ProjectMachine/FormMachine.cs
index 8973582..50cc88a 100644
--- a/ProjectMachine/ProjectMachine/FormMachine.cs
+++ b/ProjectMachine/ProjectMachine/FormMachine.cs
@@ -3,7 +3,10 @@ namespace ProjectMachine
public partial class FormMachine : Form
{
private DrawningMachine _machine;
-
+ ///
+ ///
+ ///
+ public DrawningMachine SelectedTank { get; private set; }
public FormMachine()
{
InitializeComponent();
@@ -85,9 +88,32 @@ namespace ProjectMachine
private void ButtonCreateModif_Click(object sender, EventArgs e)
{
Random rnd = new();
- _machine = new DrawningTank(rnd.Next(100, 300), rnd.Next(1000, 2000), Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256)), Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256)), Convert.ToBoolean(rnd.Next(0, 2)), Convert.ToBoolean(rnd.Next(0, 2)), Convert.ToBoolean(rnd.Next(0, 2)));
+ Color color = Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256));
+ ColorDialog dialog = new();
+ if (dialog.ShowDialog() == DialogResult.OK)
+ {
+ color = dialog.Color;
+ }
+ Color dopColor = Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256));
+ ColorDialog dialogDop = new();
+ if (dialogDop.ShowDialog() == DialogResult.OK)
+ {
+ dopColor = dialogDop.Color;
+ }
+ _machine = new DrawningTank(rnd.Next(100, 300), rnd.Next(1000, 2000), color, dopColor,
+ Convert.ToBoolean(rnd.Next(0, 2)), Convert.ToBoolean(rnd.Next(0, 2)), Convert.ToBoolean(rnd.Next(0, 2)));
SetData();
Draw();
}
+ ///
+ /// ""
+ ///
+ ///
+ ///
+ private void ButtonSelectCar_Click(object sender, EventArgs e)
+ {
+ SelectedTank = _machine;
+ DialogResult = DialogResult.OK;
+ }
}
}
\ No newline at end of file
diff --git a/ProjectMachine/ProjectMachine/FormMapWithSetTank.Designer.cs b/ProjectMachine/ProjectMachine/FormMapWithSetTank.Designer.cs
new file mode 100644
index 0000000..ccdb92f
--- /dev/null
+++ b/ProjectMachine/ProjectMachine/FormMapWithSetTank.Designer.cs
@@ -0,0 +1,39 @@
+namespace ProjectMachine
+{
+ partial class FormMapWithSetTank
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(800, 450);
+ this.Text = "FormMapWithSetTank";
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/ProjectMachine/ProjectMachine/FormMapWithSetTank.cs b/ProjectMachine/ProjectMachine/FormMapWithSetTank.cs
new file mode 100644
index 0000000..26928fc
--- /dev/null
+++ b/ProjectMachine/ProjectMachine/FormMapWithSetTank.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace ProjectMachine
+{
+ public partial class FormMapWithSetTank : Form
+ {
+ public FormMapWithSetTank()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/ProjectMachine/ProjectMachine/FormMapWithSetTank.resx b/ProjectMachine/ProjectMachine/FormMapWithSetTank.resx
new file mode 100644
index 0000000..1af7de1
--- /dev/null
+++ b/ProjectMachine/ProjectMachine/FormMapWithSetTank.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file