new branch

This commit is contained in:
Игорь Гордеев 2023-09-18 13:32:20 +04:00
parent 9d693ebd7e
commit 025bd88523
12 changed files with 769 additions and 50 deletions

View File

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ElectricLocomotive
{
public enum DirectionType
{
Up = 1,
Down = 2,
Left = 3,
Right = 4
}
}

View File

@ -0,0 +1,200 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms.VisualStyles;
namespace ElectricLocomotive
{
public class DrawningElectricLocomotive
{
private EntityElectricLocomotive enitity_electric_locomotive = new EntityElectricLocomotive();
private int _startPosX;
private int _startPosY;
private const int _LengthLocomotive = 120;
private const int _HeightLocomorive=90;
public bool Init(int speed, double weight, Color bodyColor, Color additionalColor)
{
if (speed < 0 || bodyColor == additionalColor)
{
return false;
}
else
{
enitity_electric_locomotive.Init(speed, weight, bodyColor, additionalColor);
return true;
}
}
public void SetPosition(int x, int y)
{
if (x < 0 || y < 0 || x + _LengthLocomotive > ElectricLocomotive.ActiveForm.Size.Width || y + _HeightLocomorive > ElectricLocomotive.ActiveForm.Size.Height)
{
return ;
}
else
{
_startPosX = x;
_startPosY = y;
}
}
public void MoveTransport(DirectionType direction)
{
if (enitity_electric_locomotive == null)
{
return;
}
switch (direction)
{
//влево
case DirectionType.Left:
if (_startPosX - enitity_electric_locomotive.Step > 0)
{
_startPosX -= (int)enitity_electric_locomotive.Step;
}
break;
//вверх
case DirectionType.Up:
if (_startPosY - enitity_electric_locomotive.Step > 0)
{
_startPosY -= (int)enitity_electric_locomotive.Step;
}
break;
// вправо
case DirectionType.Right: // TODO: Продумать логику
if (_startPosX+_LengthLocomotive+(int)enitity_electric_locomotive.Step < ElectricLocomotive.ActiveForm.Size.Width)
{
_startPosX += (int)enitity_electric_locomotive.Step;
}
break;
//вниз
case DirectionType.Down: // TODO: Продумать логику
if (_startPosY + _HeightLocomorive + (int)enitity_electric_locomotive.Step < ElectricLocomotive.ActiveForm.Size.Height)
{
_startPosY += (int)enitity_electric_locomotive.Step;
}
break;
}
}
public void DrawTransport(Graphics g)
{
if (enitity_electric_locomotive == null)
{
return;
}
Pen pen = new(enitity_electric_locomotive.AdditionalColor);
Brush brush = new SolidBrush(enitity_electric_locomotive.BodyColor);
///ВЛ60к-1595
///ходовая
g.FillRectangle(brush, new Rectangle(_startPosX + 20, _startPosY + 45, 15, 5));
g.FillRectangle(brush, new Rectangle(_startPosX + 65, _startPosY + 45, 15, 5));
g.FillEllipse(brush, _startPosX + 15, _startPosY + 45, 10, 10);
g.FillEllipse(brush, _startPosX + 30, _startPosY + 45, 10, 10);
g.FillEllipse(brush, _startPosX + 60, _startPosY + 45, 10, 10);
g.FillEllipse(brush, _startPosX + 75, _startPosY + 45, 10, 10);
PointF[] chassis =
{
new Point(_startPosX+10, _startPosY+50),
new Point(_startPosX, _startPosY+50),
new Point(_startPosX+10, _startPosY +40),
new Point(_startPosX + 90, _startPosY+40),
new Point(_startPosX+100, _startPosY+50),
new Point(_startPosX+90,_startPosY+ 50),
new Point(_startPosX+85, _startPosY+45),
new Point(_startPosX+15, _startPosY+45),
};
g.FillPolygon(brush, chassis);
///обводка ходовой
Point[] chassisCont =
{
new Point(_startPosX+10, _startPosY+50),
new Point(_startPosX, _startPosY+50),
new Point(_startPosX+10, _startPosY +40),
new Point(_startPosX + 90, _startPosY+40),
new Point(_startPosX+100, _startPosY+50),
new Point(_startPosX+90,_startPosY+ 50),
new Point(_startPosX+85, _startPosY+45),
new Point(_startPosX+15, _startPosY+45),
};
g.DrawPolygon(pen, chassisCont);
///кабина
Point[] cabin =
{
new Point(_startPosX+20, _startPosY+10),
new Point(_startPosX+90,_startPosY+10),
new Point(_startPosX+90,_startPosY + 40),
new Point(_startPosX+10,_startPosY+40),
new Point(_startPosX+10,_startPosY+25)
};
g.DrawPolygon(pen, cabin);
g.DrawLine(pen, _startPosX + 10, _startPosY + 25, _startPosX + 90, _startPosY + 25);
///окна
g.FillRectangle(brush, _startPosX + 20, _startPosY + 15, 10, 10);
g.FillRectangle(brush, _startPosX + 35, _startPosY + 15, 10, 10);
g.FillRectangle(brush, _startPosX + 75, _startPosY + 15, 10, 10);
///дверь
g.FillRectangle(brush, _startPosX + 50, _startPosY + 15, 10, 25);
///рога
g.FillRectangle(brush, _startPosX + 25, _startPosY + 5, 15, 5);
Point[] horns =
{
new Point(_startPosX+25, _startPosY+10),
new Point(_startPosX+25, _startPosY+5),
new Point(_startPosX+33,_startPosY+5),
new Point(_startPosX+50, _startPosY),
new Point(_startPosX+33,_startPosY+5),
new Point(_startPosX+40,_startPosY+5),
new Point(_startPosX+40,_startPosY+10)
};
g.DrawPolygon(pen, horns);
g.FillRectangle(brush, _startPosX + 65, _startPosY + 5, 15, 5);
Point[] horns2 =
{
new Point(_startPosX+65, _startPosY+10),
new Point(_startPosX+65, _startPosY+5),
new Point(_startPosX+73,_startPosY+5),
new Point(_startPosX+90, _startPosY),
new Point(_startPosX+73,_startPosY+5),
new Point(_startPosX+80,_startPosY+5),
new Point(_startPosX+80,_startPosY+10)
};
g.DrawPolygon(pen, horns2);
///Батарея
g.FillRectangle(brush, _startPosX + 45, _startPosY + 5, 15, 5);
}
}
}

View File

@ -0,0 +1,138 @@
namespace ElectricLocomotive
{
partial class ElectricLocomotive
{
/// <summary>
/// Required designer variable.
/// </summary>
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(ElectricLocomotive));
pictureBoxElectroLocomotiv = new PictureBox();
buttonUp = new Button();
buttonRight = new Button();
buttonDown = new Button();
buttonLeft = new Button();
buttonCreate = new Button();
((System.ComponentModel.ISupportInitialize)pictureBoxElectroLocomotiv).BeginInit();
SuspendLayout();
//
// pictureBoxElectroLocomotiv
//
pictureBoxElectroLocomotiv.AccessibleRole = AccessibleRole.Client;
pictureBoxElectroLocomotiv.Dock = DockStyle.Fill;
pictureBoxElectroLocomotiv.Location = new Point(0, 0);
pictureBoxElectroLocomotiv.Name = "pictureBoxElectroLocomotiv";
pictureBoxElectroLocomotiv.Size = new Size(854, 467);
pictureBoxElectroLocomotiv.SizeMode = PictureBoxSizeMode.AutoSize;
pictureBoxElectroLocomotiv.TabIndex = 5;
pictureBoxElectroLocomotiv.TabStop = false;
//
// buttonUp
//
buttonUp.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
buttonUp.BackgroundImage = (Image)resources.GetObject("buttonUp.BackgroundImage");
buttonUp.BackgroundImageLayout = ImageLayout.Zoom;
buttonUp.Location = new Point(777, 389);
buttonUp.Name = "buttonUp";
buttonUp.Size = new Size(30, 30);
buttonUp.TabIndex = 10;
buttonUp.UseVisualStyleBackColor = true;
buttonUp.Click += buttonMove_Click;
//
// buttonRight
//
buttonRight.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
buttonRight.BackgroundImage = (Image)resources.GetObject("buttonRight.BackgroundImage");
buttonRight.BackgroundImageLayout = ImageLayout.Zoom;
buttonRight.Location = new Point(813, 425);
buttonRight.Name = "buttonRight";
buttonRight.Size = new Size(30, 30);
buttonRight.TabIndex = 9;
buttonRight.UseVisualStyleBackColor = true;
buttonRight.Click += buttonMove_Click;
//
// buttonDown
//
buttonDown.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
buttonDown.BackgroundImage = (Image)resources.GetObject("buttonDown.BackgroundImage");
buttonDown.BackgroundImageLayout = ImageLayout.Zoom;
buttonDown.Location = new Point(777, 425);
buttonDown.Name = "buttonDown";
buttonDown.Size = new Size(30, 30);
buttonDown.TabIndex = 8;
buttonDown.UseVisualStyleBackColor = true;
buttonDown.Click += buttonMove_Click;
//
// buttonLeft
//
buttonLeft.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
buttonLeft.BackgroundImage = (Image)resources.GetObject("buttonLeft.BackgroundImage");
buttonLeft.BackgroundImageLayout = ImageLayout.Zoom;
buttonLeft.Location = new Point(741, 425);
buttonLeft.Name = "buttonLeft";
buttonLeft.Size = new Size(30, 30);
buttonLeft.TabIndex = 7;
buttonLeft.UseVisualStyleBackColor = true;
buttonLeft.Click += buttonMove_Click;
//
// buttonCreate
//
buttonCreate.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
buttonCreate.Location = new Point(13, 425);
buttonCreate.Name = "buttonCreate";
buttonCreate.Size = new Size(108, 34);
buttonCreate.TabIndex = 6;
buttonCreate.Text = "Создать";
buttonCreate.UseVisualStyleBackColor = true;
buttonCreate.Click += buttonCreate_Click;
//
// ElectricLocomotive
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(854, 467);
Controls.Add(buttonUp);
Controls.Add(buttonRight);
Controls.Add(buttonDown);
Controls.Add(buttonLeft);
Controls.Add(buttonCreate);
Controls.Add(pictureBoxElectroLocomotiv);
Name = "ElectricLocomotive";
Text = "ElectricLocomotive";
((System.ComponentModel.ISupportInitialize)pictureBoxElectroLocomotiv).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion
private PictureBox pictureBoxElectroLocomotiv;
private Button buttonUp;
private Button buttonRight;
private Button buttonDown;
private Button buttonLeft;
private Button buttonCreate;
}
}

View File

@ -0,0 +1,64 @@
namespace ElectricLocomotive
{
public partial class ElectricLocomotive : Form
{
private DrawningElectricLocomotive? _drawningElectricLocomotive;
public ElectricLocomotive()
{
InitializeComponent();
}
private void Draw()
{
if (_drawningElectricLocomotive == null)
{
return;
}
Bitmap bmp = new(pictureBoxElectroLocomotiv.Width, pictureBoxElectroLocomotiv.Height);
Graphics gr = Graphics.FromImage(bmp);
_drawningElectricLocomotive.DrawTransport(gr);
pictureBoxElectroLocomotiv.Image = bmp;
}
private void buttonCreate_Click(object sender, EventArgs e)
{
Random random = new();
_drawningElectricLocomotive = new DrawningElectricLocomotive();
_drawningElectricLocomotive.Init(random.Next(100, 300), random.Next(1000, 3000),
Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)),
Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)));
_drawningElectricLocomotive.SetPosition(random.Next(10, 100), random.Next(10, 100));
Draw();
}
private void buttonMove_Click(object sender, EventArgs e)
{
if (_drawningElectricLocomotive == null)
{
return;
}
string name = ((Button)sender)?.Name ?? string.Empty;
switch (name)
{
case "buttonUp":
_drawningElectricLocomotive.MoveTransport(DirectionType.Up);
break;
case "buttonDown":
_drawningElectricLocomotive.MoveTransport(DirectionType.Down);
break;
case "buttonLeft":
_drawningElectricLocomotive.MoveTransport(DirectionType.Left);
break;
case "buttonRight":
_drawningElectricLocomotive.MoveTransport(DirectionType.Right);
break;
}
Draw();
}
}
}

View File

@ -8,4 +8,19 @@
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
</Project>

View File

@ -0,0 +1,234 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="buttonUp.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABGdBTUEAALGPC/xhBQAAAX1JREFUaEPt
2T0rhXEcxvHjqbwGg+IVyMxIJpOyGEweFpPYZbBQMpmYFEViZGWR1yJi8Ox71bnr390lHbq5f/l/61P6
36dzX4fOGZxGLpfL5epaL+Ywix4dRGocd3hvusEYQjSJJxTjC4+YQK2bwjPK4wsvmEYtm8cr3PDUGxZQ
q5bhxn5GL2IRtajV8ak1/FltWIcb1oot6Ll+Nd1QN3aDvmMb7fiVOrALN+Qn9tCJStMNDuEGFM7NWeHM
nKX03PoFVdZXb9hTdJfOUrp2UjorW0JlXcLdVA7QBeWui9Jj9uGuywUq6xjupnpPpH969xgp0mN34B5z
hMoaxAPSG+rTqPwJkl5PpemTbBPp9XsMoNL6sQrdfFQHpnRUyjWCDaygTwd1yI2XMLnxEiY3XsLkxkuY
3HgJkxsvYXLjJUxuvITJjZcwufESJjdewuTGS5jceAmTGy9hcv9e1FmYrlF+AVcI0zBuUYzXz0MIlb7U
mGkK9wVHLpfL/YsajQ+TA0YtgOqCtwAAAABJRU5ErkJggg==
</value>
</data>
<data name="buttonRight.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAABGdBTUEAALGPC/xhBQAAEZ5JREFUeF7t
3Ymv5WV9x/GZYZhhXwQRcWFRwWIEBbdUFDXVqNSorbiBojVqca1FSqgkWmtJCorFtRqhRLCgRSyRWhQF
64KmUrFiVJSoA7KIAgNlBgZmpv08qQmtfIGZ3+/euc855/VK3v/A5Dnzufee37IIAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgGEW
Lfof8qiDQ1mFN78AAAAASUVORK5CYII=
</value>
</data>
<data name="buttonDown.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
DAAACwwBP0AiyAAAASRJREFUaEPtmL0KwjAURiv4AK6Co6KCoDgr/ryKvoSb7+Tk4mu46CIiooKDOut3
ay+EklQXexO5Bw4kaYac0hYxUhR/qcJNIo2DYwafiTQOjjnkABoHhwZIowHSaIA0GiCNBkijAdJogDQa
II0GSKMB0miANBogjQb8khKcwkY8s/NtQBlOYCWe5cQC0sHucEALFr4JqMM9pD1rWsiLFeTDuSI+BTTh
AfKeHcwN+r+f7xxpi8gKaMEj5Os32IO5UoNmxAOOIeMKaMMT5GsUP4QiZEXYAjrwDM39YodnXBHpgC68
GGu0bwS9IB1Bj8XSmNNX62rM6ZnvQ69IR7j06s6n+RTh9eEZV0QQh2dsL3Ywh2coYgvpy+P6ueE9BVh8
D5V/JIpe+j/GQF3wLqYAAAAASUVORK5CYII=
</value>
</data>
<data name="buttonLeft.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABGdBTUEAALGPC/xhBQAAAMNJREFUaEPt
1T0OAVEUhuGbWAYW4GcBGksgbIZSSWxKBDugwgZmBWh4T6K4ubmmUMg98T3J20wyyXeamSAiIiIi/6VN
ezpR1x54YuMv9Hy3JjfS8Q8akgu58RNyoUWux59J438tN35KLrge36R4vLWheSHNqE8fbSkeX2IVNShr
R7mXSqr2APthXSl+4UCrQlpQj2qlf907jcgVHVEKHVGK3BFjcsWOiD+xNxqQK+kRS3LHjrA/9pE69kBE
RERE5AshvACI8cWowOkNEgAAAABJRU5ErkJggg==
</value>
</data>
</root>

View File

@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ElectricLocomotive
{
public class EntityElectricLocomotive
{
public int Speed { get; private set; }
public double Weight { get; private set; }
public Color BodyColor { get; private set; }
public Color AdditionalColor { get; private set; }
public double Step => (double)Speed * 100 / Weight;
public void Init(int speed, double weight, Color bodyColor, Color additionalColor)
{
Speed = speed;
Weight = weight;
BodyColor = bodyColor;
AdditionalColor = additionalColor;
}
}
}

View File

@ -1,39 +0,0 @@
namespace ElectricLocomotive
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
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()
{
this.components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Text = "Form1";
}
#endregion
}
}

View File

@ -1,10 +0,0 @@
namespace ElectricLocomotive
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
}
}

View File

@ -11,7 +11,7 @@ namespace ElectricLocomotive
// To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();
Application.Run(new Form1());
Application.Run(new ElectricLocomotive());
}
}
}

View File

@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Этот код создан программой.
// Исполняемая версия:4.0.30319.42000
//
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
// повторной генерации кода.
// </auto-generated>
//------------------------------------------------------------------------------
namespace ElectricLocomotive.Properties {
using System;
/// <summary>
/// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д.
/// </summary>
// Этот класс создан автоматически классом StronglyTypedResourceBuilder
// с помощью такого средства, как ResGen или Visual Studio.
// Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen
// с параметром /str или перестройте свой проект VS.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ElectricLocomotive.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Перезаписывает свойство CurrentUICulture текущего потока для всех
/// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}