Correction due to changes in lab5
This commit is contained in:
parent
c518fb92c9
commit
3cc7bee7ad
@ -12,9 +12,9 @@ public class DrawingSAU : DrawingBase
|
|||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
public DrawingSAU(int speed, double weight, Color bodyColor, Color additionalColor, bool guns) : base(150, 100)
|
public DrawingSAU(int speed, double weight, Color bodyColor, Color additionalColor, bool tracks, bool guns) : base(150, 100)
|
||||||
{
|
{
|
||||||
BaseSAU = new EntitySAU( speed, weight, bodyColor, additionalColor, guns);
|
BaseSAU = new EntitySAU( speed, weight, bodyColor, additionalColor, tracks, guns);
|
||||||
|
|
||||||
}
|
}
|
||||||
public DrawingSAU(BaseSAU? baseSAU)
|
public DrawingSAU(BaseSAU? baseSAU)
|
||||||
@ -36,10 +36,6 @@ public class DrawingSAU : DrawingBase
|
|||||||
Brush additionalBrush = new SolidBrush(SAU.AdditionalColor);
|
Brush additionalBrush = new SolidBrush(SAU.AdditionalColor);
|
||||||
|
|
||||||
|
|
||||||
//гусеницы
|
|
||||||
g.FillEllipse(additionalBrush, _startPosX.Value, _startPosY.Value + 55, 130, 40);
|
|
||||||
|
|
||||||
|
|
||||||
//пулеметы
|
//пулеметы
|
||||||
|
|
||||||
if (SAU.Guns)
|
if (SAU.Guns)
|
||||||
@ -53,7 +49,10 @@ public class DrawingSAU : DrawingBase
|
|||||||
base.DrawSAU(g);
|
base.DrawSAU(g);
|
||||||
|
|
||||||
//гусеницы
|
//гусеницы
|
||||||
g.FillEllipse(additionalBrush, _startPosX.Value, _startPosY.Value + 55, 130, 40);
|
if (SAU.Tracks)
|
||||||
|
{
|
||||||
|
g.FillEllipse(additionalBrush, _startPosX.Value, _startPosY.Value + 55, 130, 40);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,14 +11,14 @@ public class EntitySAU: BaseSAU
|
|||||||
|
|
||||||
|
|
||||||
public Color AdditionalColor { get; private set; }
|
public Color AdditionalColor { get; private set; }
|
||||||
//public bool Tracks { get; private set; }
|
public bool Tracks { get; private set; }
|
||||||
|
|
||||||
public bool Guns { get; private set; }
|
public bool Guns { get; private set; }
|
||||||
|
|
||||||
public EntitySAU(int speed, double weight, Color bodyColor, Color additionalColor, bool guns) : base(speed, weight, bodyColor)
|
public EntitySAU(int speed, double weight, Color bodyColor, Color additionalColor, bool tracks, bool guns) : base(speed, weight, bodyColor)
|
||||||
{
|
{
|
||||||
AdditionalColor = additionalColor;
|
AdditionalColor = additionalColor;
|
||||||
|
Tracks = tracks;
|
||||||
Guns = guns;
|
Guns = guns;
|
||||||
}
|
}
|
||||||
public void SetAdditionalColor(Color additionalColor)
|
public void SetAdditionalColor(Color additionalColor)
|
||||||
@ -39,6 +39,6 @@ public class EntitySAU: BaseSAU
|
|||||||
}
|
}
|
||||||
|
|
||||||
return new EntitySAU(Convert.ToInt32(strs[1]), Convert.ToDouble(strs[2]), Color.FromName(strs[3]), Color.FromName(strs[4]),
|
return new EntitySAU(Convert.ToInt32(strs[1]), Convert.ToDouble(strs[2]), Color.FromName(strs[3]), Color.FromName(strs[4]),
|
||||||
Convert.ToBoolean(strs[5]));
|
Convert.ToBoolean(strs[5]), Convert.ToBoolean(strs[6]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -51,6 +51,7 @@
|
|||||||
panelObject = new Panel();
|
panelObject = new Panel();
|
||||||
labelAdditionalColor = new Label();
|
labelAdditionalColor = new Label();
|
||||||
labelBodyColor = new Label();
|
labelBodyColor = new Label();
|
||||||
|
checkBoxTracks = new CheckBox();
|
||||||
groupBoxConfig.SuspendLayout();
|
groupBoxConfig.SuspendLayout();
|
||||||
groupBoxColors.SuspendLayout();
|
groupBoxColors.SuspendLayout();
|
||||||
((System.ComponentModel.ISupportInitialize)numericUpDownWeight).BeginInit();
|
((System.ComponentModel.ISupportInitialize)numericUpDownWeight).BeginInit();
|
||||||
@ -61,6 +62,7 @@
|
|||||||
//
|
//
|
||||||
// groupBoxConfig
|
// groupBoxConfig
|
||||||
//
|
//
|
||||||
|
groupBoxConfig.Controls.Add(checkBoxTracks);
|
||||||
groupBoxConfig.Controls.Add(groupBoxColors);
|
groupBoxConfig.Controls.Add(groupBoxColors);
|
||||||
groupBoxConfig.Controls.Add(labelSimpleObject);
|
groupBoxConfig.Controls.Add(labelSimpleObject);
|
||||||
groupBoxConfig.Controls.Add(checkBoxGuns);
|
groupBoxConfig.Controls.Add(checkBoxGuns);
|
||||||
@ -310,6 +312,16 @@
|
|||||||
labelBodyColor.DragDrop += labelBodyColor_DragDrop;
|
labelBodyColor.DragDrop += labelBodyColor_DragDrop;
|
||||||
labelBodyColor.DragEnter += labelBodyColor_DragEnter;
|
labelBodyColor.DragEnter += labelBodyColor_DragEnter;
|
||||||
//
|
//
|
||||||
|
// checkBoxTracks
|
||||||
|
//
|
||||||
|
checkBoxTracks.AutoSize = true;
|
||||||
|
checkBoxTracks.Location = new Point(12, 135);
|
||||||
|
checkBoxTracks.Name = "checkBoxTracks";
|
||||||
|
checkBoxTracks.Size = new Size(232, 24);
|
||||||
|
checkBoxTracks.TabIndex = 9;
|
||||||
|
checkBoxTracks.Text = "Признак наличия пулеметов";
|
||||||
|
checkBoxTracks.UseVisualStyleBackColor = true;
|
||||||
|
//
|
||||||
// FormSAUConfig
|
// FormSAUConfig
|
||||||
//
|
//
|
||||||
AutoScaleDimensions = new SizeF(8F, 20F);
|
AutoScaleDimensions = new SizeF(8F, 20F);
|
||||||
@ -356,5 +368,6 @@
|
|||||||
private Panel panelObject;
|
private Panel panelObject;
|
||||||
private Label labelBodyColor;
|
private Label labelBodyColor;
|
||||||
private Label labelAdditionalColor;
|
private Label labelAdditionalColor;
|
||||||
|
private CheckBox checkBoxTracks;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -68,7 +68,7 @@ public partial class FormSAUConfig : Form
|
|||||||
break;
|
break;
|
||||||
case "labelModifiedObject":
|
case "labelModifiedObject":
|
||||||
_drawingBase = new DrawingSAU((int)numericUpDownSpeed.Value, (double)numericUpDownWeight.Value, Color.White,
|
_drawingBase = new DrawingSAU((int)numericUpDownSpeed.Value, (double)numericUpDownWeight.Value, Color.White,
|
||||||
Color.Black, checkBoxGuns.Checked);
|
Color.Black, checkBoxTracks.Checked, checkBoxGuns.Checked);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user