Добавлена возможность добавлять различные типы двигателя для генерации
This commit is contained in:
parent
7259d846ed
commit
52c040d55b
@ -28,6 +28,7 @@
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent()
|
private void InitializeComponent()
|
||||||
{
|
{
|
||||||
|
this.comboTypeEngines = new System.Windows.Forms.ComboBox();
|
||||||
this.groupBoxTools = new System.Windows.Forms.GroupBox();
|
this.groupBoxTools = new System.Windows.Forms.GroupBox();
|
||||||
this.labelSpeed = new System.Windows.Forms.Label();
|
this.labelSpeed = new System.Windows.Forms.Label();
|
||||||
this.numericSpeed = new System.Windows.Forms.NumericUpDown();
|
this.numericSpeed = new System.Windows.Forms.NumericUpDown();
|
||||||
@ -36,7 +37,7 @@
|
|||||||
this.btnGenerateAirplane = new System.Windows.Forms.Button();
|
this.btnGenerateAirplane = new System.Windows.Forms.Button();
|
||||||
this.labelCountEngines = new System.Windows.Forms.Label();
|
this.labelCountEngines = new System.Windows.Forms.Label();
|
||||||
this.numericUpDownEngines = new System.Windows.Forms.NumericUpDown();
|
this.numericUpDownEngines = new System.Windows.Forms.NumericUpDown();
|
||||||
this.btnAddCountEngines = new System.Windows.Forms.Button();
|
this.btnAddTypeOfEngines = new System.Windows.Forms.Button();
|
||||||
this.buttonAddTypeOfEntity = new System.Windows.Forms.Button();
|
this.buttonAddTypeOfEntity = new System.Windows.Forms.Button();
|
||||||
this.buttonDown = new System.Windows.Forms.Button();
|
this.buttonDown = new System.Windows.Forms.Button();
|
||||||
this.buttonRight = new System.Windows.Forms.Button();
|
this.buttonRight = new System.Windows.Forms.Button();
|
||||||
@ -51,8 +52,22 @@
|
|||||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit();
|
((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
//
|
//
|
||||||
|
// comboTypeEngines
|
||||||
|
//
|
||||||
|
this.comboTypeEngines.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||||
|
this.comboTypeEngines.FormattingEnabled = true;
|
||||||
|
this.comboTypeEngines.Items.AddRange(new object[] {
|
||||||
|
"Закругленный",
|
||||||
|
"Квадратный",
|
||||||
|
"Стрелка"});
|
||||||
|
this.comboTypeEngines.Location = new System.Drawing.Point(17, 155);
|
||||||
|
this.comboTypeEngines.Name = "comboTypeEngines";
|
||||||
|
this.comboTypeEngines.Size = new System.Drawing.Size(175, 23);
|
||||||
|
this.comboTypeEngines.TabIndex = 9;
|
||||||
|
//
|
||||||
// groupBoxTools
|
// groupBoxTools
|
||||||
//
|
//
|
||||||
|
this.groupBoxTools.Controls.Add(this.comboTypeEngines);
|
||||||
this.groupBoxTools.Controls.Add(this.labelSpeed);
|
this.groupBoxTools.Controls.Add(this.labelSpeed);
|
||||||
this.groupBoxTools.Controls.Add(this.numericSpeed);
|
this.groupBoxTools.Controls.Add(this.numericSpeed);
|
||||||
this.groupBoxTools.Controls.Add(this.labelWeight);
|
this.groupBoxTools.Controls.Add(this.labelWeight);
|
||||||
@ -60,7 +75,7 @@
|
|||||||
this.groupBoxTools.Controls.Add(this.btnGenerateAirplane);
|
this.groupBoxTools.Controls.Add(this.btnGenerateAirplane);
|
||||||
this.groupBoxTools.Controls.Add(this.labelCountEngines);
|
this.groupBoxTools.Controls.Add(this.labelCountEngines);
|
||||||
this.groupBoxTools.Controls.Add(this.numericUpDownEngines);
|
this.groupBoxTools.Controls.Add(this.numericUpDownEngines);
|
||||||
this.groupBoxTools.Controls.Add(this.btnAddCountEngines);
|
this.groupBoxTools.Controls.Add(this.btnAddTypeOfEngines);
|
||||||
this.groupBoxTools.Controls.Add(this.buttonAddTypeOfEntity);
|
this.groupBoxTools.Controls.Add(this.buttonAddTypeOfEntity);
|
||||||
this.groupBoxTools.Controls.Add(this.buttonDown);
|
this.groupBoxTools.Controls.Add(this.buttonDown);
|
||||||
this.groupBoxTools.Controls.Add(this.buttonRight);
|
this.groupBoxTools.Controls.Add(this.buttonRight);
|
||||||
@ -109,7 +124,7 @@
|
|||||||
//
|
//
|
||||||
// btnGenerateAirplane
|
// btnGenerateAirplane
|
||||||
//
|
//
|
||||||
this.btnGenerateAirplane.Location = new System.Drawing.Point(17, 233);
|
this.btnGenerateAirplane.Location = new System.Drawing.Point(17, 263);
|
||||||
this.btnGenerateAirplane.Name = "btnGenerateAirplane";
|
this.btnGenerateAirplane.Name = "btnGenerateAirplane";
|
||||||
this.btnGenerateAirplane.Size = new System.Drawing.Size(175, 23);
|
this.btnGenerateAirplane.Size = new System.Drawing.Size(175, 23);
|
||||||
this.btnGenerateAirplane.TabIndex = 15;
|
this.btnGenerateAirplane.TabIndex = 15;
|
||||||
@ -120,7 +135,7 @@
|
|||||||
// labelCountEngines
|
// labelCountEngines
|
||||||
//
|
//
|
||||||
this.labelCountEngines.AutoSize = true;
|
this.labelCountEngines.AutoSize = true;
|
||||||
this.labelCountEngines.Location = new System.Drawing.Point(17, 157);
|
this.labelCountEngines.Location = new System.Drawing.Point(17, 187);
|
||||||
this.labelCountEngines.Name = "labelCountEngines";
|
this.labelCountEngines.Name = "labelCountEngines";
|
||||||
this.labelCountEngines.Size = new System.Drawing.Size(113, 15);
|
this.labelCountEngines.Size = new System.Drawing.Size(113, 15);
|
||||||
this.labelCountEngines.TabIndex = 14;
|
this.labelCountEngines.TabIndex = 14;
|
||||||
@ -128,20 +143,20 @@
|
|||||||
//
|
//
|
||||||
// numericUpDownEngines
|
// numericUpDownEngines
|
||||||
//
|
//
|
||||||
this.numericUpDownEngines.Location = new System.Drawing.Point(136, 155);
|
this.numericUpDownEngines.Location = new System.Drawing.Point(136, 185);
|
||||||
this.numericUpDownEngines.Name = "numericUpDownEngines";
|
this.numericUpDownEngines.Name = "numericUpDownEngines";
|
||||||
this.numericUpDownEngines.Size = new System.Drawing.Size(56, 23);
|
this.numericUpDownEngines.Size = new System.Drawing.Size(56, 23);
|
||||||
this.numericUpDownEngines.TabIndex = 13;
|
this.numericUpDownEngines.TabIndex = 13;
|
||||||
//
|
//
|
||||||
// btnAddCountEngines
|
// btnAddTypeOfEngines
|
||||||
//
|
//
|
||||||
this.btnAddCountEngines.Location = new System.Drawing.Point(17, 184);
|
this.btnAddTypeOfEngines.Location = new System.Drawing.Point(17, 214);
|
||||||
this.btnAddCountEngines.Name = "btnAddCountEngines";
|
this.btnAddTypeOfEngines.Name = "btnAddTypeOfEngines";
|
||||||
this.btnAddCountEngines.Size = new System.Drawing.Size(175, 43);
|
this.btnAddTypeOfEngines.Size = new System.Drawing.Size(175, 43);
|
||||||
this.btnAddCountEngines.TabIndex = 12;
|
this.btnAddTypeOfEngines.TabIndex = 12;
|
||||||
this.btnAddCountEngines.Text = "Добавить кол-во двигателей для генерации";
|
this.btnAddTypeOfEngines.Text = "Добавить тип двигателя и их кол-во для генерации";
|
||||||
this.btnAddCountEngines.UseVisualStyleBackColor = true;
|
this.btnAddTypeOfEngines.UseVisualStyleBackColor = true;
|
||||||
this.btnAddCountEngines.Click += new System.EventHandler(this.btnAddCountEngines_Click);
|
this.btnAddTypeOfEngines.Click += new System.EventHandler(this.btnAddTypeOfEngines_Click);
|
||||||
//
|
//
|
||||||
// buttonAddTypeOfEntity
|
// buttonAddTypeOfEntity
|
||||||
//
|
//
|
||||||
@ -240,6 +255,7 @@
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
private ComboBox comboTypeEngines;
|
||||||
private GroupBox groupBoxTools;
|
private GroupBox groupBoxTools;
|
||||||
private PictureBox pictureBox;
|
private PictureBox pictureBox;
|
||||||
private ComboBox comboBoxSelectorMap;
|
private ComboBox comboBoxSelectorMap;
|
||||||
@ -247,7 +263,7 @@
|
|||||||
private Button buttonRight;
|
private Button buttonRight;
|
||||||
private Button buttonLeft;
|
private Button buttonLeft;
|
||||||
private Button buttonUp;
|
private Button buttonUp;
|
||||||
private Button btnAddCountEngines;
|
private Button btnAddTypeOfEngines;
|
||||||
private Button buttonAddTypeOfEntity;
|
private Button buttonAddTypeOfEntity;
|
||||||
private Label labelCountEngines;
|
private Label labelCountEngines;
|
||||||
private NumericUpDown numericUpDownEngines;
|
private NumericUpDown numericUpDownEngines;
|
||||||
|
@ -109,11 +109,23 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void btnAddCountEngines_Click(object sender, EventArgs e)
|
private void btnAddTypeOfEngines_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
IAirplaneEngines engines = new DrawningAirplaneEngines();
|
IAirplaneEngines? typeAirplaneEngines = null;
|
||||||
engines.CountEngines = (int)numericUpDownEngines.Value;
|
switch (comboTypeEngines.Text)
|
||||||
_generatorAirplane.AddTypeOfEngines(engines);
|
{
|
||||||
|
case "Квадратный":
|
||||||
|
typeAirplaneEngines = new AirplaneRectEngines();
|
||||||
|
break;
|
||||||
|
case "Стрелка":
|
||||||
|
typeAirplaneEngines = new AirplaneArrowEngines();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
typeAirplaneEngines = new DrawningAirplaneEngines();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
typeAirplaneEngines.CountEngines = (int)numericUpDownEngines.Value;
|
||||||
|
_generatorAirplane.AddTypeOfEngines(typeAirplaneEngines);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user