Compare commits

..

No commits in common. "Лаб_2" and "main" have entirely different histories.

29 changed files with 0 additions and 1778 deletions

View File

@ -1,25 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.7.34024.191
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DoubleDeckerBus", "DoubleDeckerBus\DoubleDeckerBus.csproj", "{733E4772-39B5-4155-BB09-07F2025C8475}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{733E4772-39B5-4155-BB09-07F2025C8475}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{733E4772-39B5-4155-BB09-07F2025C8475}.Debug|Any CPU.Build.0 = Debug|Any CPU
{733E4772-39B5-4155-BB09-07F2025C8475}.Release|Any CPU.ActiveCfg = Release|Any CPU
{733E4772-39B5-4155-BB09-07F2025C8475}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {5A7B2FB1-2C70-4096-8533-3A0542E01030}
EndGlobalSection
EndGlobal

View File

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

View File

@ -1,193 +0,0 @@
namespace DoubleDeckerBus
{
partial class DoubleDeckerBus
{
/// <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()
{
pictureBoxBus = new PictureBox();
buttonCreateBus = new Button();
buttonUp = new Button();
buttonLeft = new Button();
buttonDown = new Button();
buttonRight = new Button();
buttonCreatDoubleDeckerDus = new Button();
buttonStep_Click = new Button();
comboBoxStrategy = new ComboBox();
buttonSelectBus = new Button();
((System.ComponentModel.ISupportInitialize)pictureBoxBus).BeginInit();
SuspendLayout();
//
// pictureBoxBus
//
pictureBoxBus.Dock = DockStyle.Fill;
pictureBoxBus.Location = new Point(0, 0);
pictureBoxBus.Name = "pictureBoxBus";
pictureBoxBus.Size = new Size(884, 461);
pictureBoxBus.SizeMode = PictureBoxSizeMode.AutoSize;
pictureBoxBus.TabIndex = 0;
pictureBoxBus.TabStop = false;
//
// buttonCreateBus
//
buttonCreateBus.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
buttonCreateBus.Location = new Point(12, 409);
buttonCreateBus.Name = "buttonCreateBus";
buttonCreateBus.Size = new Size(117, 40);
buttonCreateBus.TabIndex = 1;
buttonCreateBus.Text = "Создать автобус";
buttonCreateBus.UseVisualStyleBackColor = true;
buttonCreateBus.Click += buttonCreateBus_Click;
//
// buttonUp
//
buttonUp.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
buttonUp.BackgroundImage = Properties.Resources.arrowUp;
buttonUp.BackgroundImageLayout = ImageLayout.Zoom;
buttonUp.Location = new Point(806, 386);
buttonUp.Name = "buttonUp";
buttonUp.Size = new Size(30, 30);
buttonUp.TabIndex = 2;
buttonUp.UseVisualStyleBackColor = true;
buttonUp.AutoSizeChanged += ButtonMove_Click;
buttonUp.Click += ButtonMove_Click;
//
// buttonLeft
//
buttonLeft.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
buttonLeft.BackgroundImage = Properties.Resources.arrowLeft;
buttonLeft.BackgroundImageLayout = ImageLayout.Zoom;
buttonLeft.Location = new Point(770, 422);
buttonLeft.Name = "buttonLeft";
buttonLeft.Size = new Size(30, 30);
buttonLeft.TabIndex = 3;
buttonLeft.UseVisualStyleBackColor = true;
buttonLeft.AutoSizeChanged += ButtonMove_Click;
buttonLeft.Click += ButtonMove_Click;
//
// buttonDown
//
buttonDown.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
buttonDown.BackgroundImage = Properties.Resources.arrowDown;
buttonDown.BackgroundImageLayout = ImageLayout.Zoom;
buttonDown.Location = new Point(806, 422);
buttonDown.Name = "buttonDown";
buttonDown.Size = new Size(30, 30);
buttonDown.TabIndex = 4;
buttonDown.UseVisualStyleBackColor = true;
buttonDown.AutoSizeChanged += ButtonMove_Click;
buttonDown.Click += ButtonMove_Click;
//
// buttonRight
//
buttonRight.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
buttonRight.BackgroundImage = Properties.Resources.arrowRight;
buttonRight.BackgroundImageLayout = ImageLayout.Zoom;
buttonRight.Location = new Point(842, 422);
buttonRight.Name = "buttonRight";
buttonRight.Size = new Size(30, 30);
buttonRight.TabIndex = 5;
buttonRight.UseVisualStyleBackColor = true;
buttonRight.AutoSizeChanged += ButtonMove_Click;
buttonRight.Click += ButtonMove_Click;
//
// buttonCreatDoubleDeckerDus
//
buttonCreatDoubleDeckerDus.Location = new Point(135, 409);
buttonCreatDoubleDeckerDus.Name = "buttonCreatDoubleDeckerDus";
buttonCreatDoubleDeckerDus.Size = new Size(136, 40);
buttonCreatDoubleDeckerDus.TabIndex = 6;
buttonCreatDoubleDeckerDus.Text = "Создать двухэтажный автобус";
buttonCreatDoubleDeckerDus.UseVisualStyleBackColor = true;
buttonCreatDoubleDeckerDus.Click += buttonCreatDoubleDeckerDus_Click;
//
// buttonStep_Click
//
buttonStep_Click.Location = new Point(797, 41);
buttonStep_Click.Name = "buttonStep_Click";
buttonStep_Click.Size = new Size(75, 23);
buttonStep_Click.TabIndex = 7;
buttonStep_Click.Text = "Шаг";
buttonStep_Click.UseVisualStyleBackColor = true;
buttonStep_Click.Click += buttonStep_Click_Click;
//
// comboBoxStrategy
//
comboBoxStrategy.DropDownStyle = ComboBoxStyle.DropDownList;
comboBoxStrategy.FormattingEnabled = true;
comboBoxStrategy.Items.AddRange(new object[] { "MoveToCenter", "MoveToBorder" });
comboBoxStrategy.Location = new Point(751, 12);
comboBoxStrategy.Name = "comboBoxStrategy";
comboBoxStrategy.Size = new Size(121, 23);
comboBoxStrategy.TabIndex = 8;
//
// buttonSelectBus
//
buttonSelectBus.Location = new Point(277, 418);
buttonSelectBus.Name = "buttonSelectBus";
buttonSelectBus.Size = new Size(109, 31);
buttonSelectBus.TabIndex = 9;
buttonSelectBus.Text = "Выбрать";
buttonSelectBus.UseVisualStyleBackColor = true;
buttonSelectBus.Click += buttonSelectBus_Click;
//
// DoubleDeckerBus
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(884, 461);
Controls.Add(buttonSelectBus);
Controls.Add(comboBoxStrategy);
Controls.Add(buttonStep_Click);
Controls.Add(buttonCreatDoubleDeckerDus);
Controls.Add(buttonRight);
Controls.Add(buttonDown);
Controls.Add(buttonLeft);
Controls.Add(buttonUp);
Controls.Add(buttonCreateBus);
Controls.Add(pictureBoxBus);
Name = "DoubleDeckerBus";
StartPosition = FormStartPosition.CenterParent;
Text = "DoubleDeckerBus";
((System.ComponentModel.ISupportInitialize)pictureBoxBus).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion
private PictureBox pictureBoxBus;
private Button buttonCreateBus;
private Button buttonUp;
private Button buttonLeft;
private Button buttonDown;
private Button buttonRight;
private Button buttonCreatDoubleDeckerDus;
private Button buttonStep_Click;
private ComboBox comboBoxStrategy;
private Button buttonSelectBus;
}
}

View File

@ -1,137 +0,0 @@
using DoubleDeckerBus.DrawningObjects;
using DoubleDeckerBus.MovementStrategy;
namespace DoubleDeckerBus
{
public partial class DoubleDeckerBus : Form
{
private DrawningBus? _drawningBus;
private AbstractStrategy? _strategy;
public DrawningBus? SelectedBus { get; private set; }
public DoubleDeckerBus()
{
InitializeComponent();
_strategy = null;
SelectedBus = null;
}
private void Draw()
{
if (_drawningBus == null)
{
return;
}
Bitmap bmp = new(pictureBoxBus.Width, pictureBoxBus.Height);
Graphics gr = Graphics.FromImage(bmp);
_drawningBus.DrawTransport(gr);
pictureBoxBus.Image = bmp;
}
private void buttonCreateBus_Click(object sender, EventArgs e)
{
Random random = new();
Color color = Color.FromArgb(random.Next(0, 256),
random.Next(0, 256), random.Next(0, 256));
ColorDialog dialog = new();
if (dialog.ShowDialog() == DialogResult.OK)
{
color = dialog.Color;
}
_drawningBus = new DrawningBus(random.Next(100, 300),
random.Next(1000, 3000), color,
pictureBoxBus.Width, pictureBoxBus.Height);
_drawningBus.SetPosition(random.Next(10, 100), random.Next(10,
100));
Draw();
}
private void buttonCreatDoubleDeckerDus_Click(object sender, EventArgs e)
{
Random random = new();
Color color = Color.FromArgb(random.Next(0, 256),
random.Next(0, 256), random.Next(0, 256));
ColorDialog dialogColor = new();
if (dialogColor.ShowDialog() == DialogResult.OK)
{
color = dialogColor.Color;
}
Color dopColor = Color.FromArgb(random.Next(0, 256),
random.Next(0, 256), random.Next(0, 256));
ColorDialog dialogDopColor = new();
if (dialogDopColor.ShowDialog() == DialogResult.OK)
{
dopColor = dialogDopColor.Color;
}
_drawningBus = new DrawningDoubleDeckerBus(random.Next(100, 300),
random.Next(1000, 3000), color,
dopColor, Convert.ToBoolean(random.Next(0, 2)),
Convert.ToBoolean(random.Next(0, 2)),
Convert.ToBoolean(random.Next(0, 2)),
pictureBoxBus.Width, pictureBoxBus.Height);
_drawningBus.SetPosition(random.Next(10, 100), random.Next(10,
100));
Draw();
}
private void ButtonMove_Click(object sender, EventArgs e)
{
if (_drawningBus == null)
{
return;
}
string name = ((Button)sender)?.Name ?? string.Empty;
switch (name)
{
case "buttonUp":
_drawningBus.MoveTransport(DirectionBus.Up);
break;
case "buttonDown":
_drawningBus.MoveTransport(DirectionBus.Down);
break;
case "buttonLeft":
_drawningBus.MoveTransport(DirectionBus.Left);
break;
case "buttonRight":
_drawningBus.MoveTransport(DirectionBus.Right);
break;
}
Draw();
}
private void buttonStep_Click_Click(object sender, EventArgs e)
{
if (_drawningBus == null)
{
return;
}
if (comboBoxStrategy.Enabled)
{
_strategy = comboBoxStrategy.SelectedIndex switch
{
0 => new MoveToCenter(),
1 => new MoveToBorder(),
_ => null,
};
if (_strategy == null)
{
return;
}
_strategy.SetData(_drawningBus.GetMoveableObject,
pictureBoxBus.Width, pictureBoxBus.Height);
}
if (_strategy == null)
{
return;
}
comboBoxStrategy.Enabled = false;
_strategy.MakeStep();
Draw();
if (_strategy.GetStatus() == Status.Finish)
{
comboBoxStrategy.Enabled = true;
_strategy = null;
}
}
private void buttonSelectBus_Click(object sender, EventArgs e)
{
SelectedBus = _drawningBus;
DialogResult = DialogResult.OK;
}
}
}

View File

@ -1,11 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
</Project>

View File

@ -1,120 +0,0 @@
<?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>
</root>

View File

@ -1,138 +0,0 @@
using DoubleDeckerBus.Entities;
using DoubleDeckerBus.MovementStrategy;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DoubleDeckerBus.DrawningObjects
{
public class DrawningBus
{
public EntityBus? EntityBus { get; protected set; }
public IMoveableObject GetMoveableObject => new DrawningObjectBus(this);
private int? _pictureWidth;
private int? _pictureHeight;
protected int _startPosX;
protected int _startPosY;
protected readonly int _busWidth = 110;
protected readonly int _busHeight = 70;
public int GetPosX => _startPosX;
public int GetPosY => _startPosY;
public int GetWidth => _busWidth;
public int GetHeight => _busHeight;
public DrawningBus(int speed, float weight, Color bodyColor, int width, int height)
{
if (width < _busWidth || height < _busHeight)
{
return;
}
_pictureWidth = width;
_pictureHeight = height;
EntityBus = new EntityBus(speed, weight, bodyColor);
}
protected DrawningBus(int speed, float weight, Color bodyColor, int width, int height, int busWidth, int busHeight)
{
if (width <= _busWidth || height <= _busHeight)
{
return;
}
_pictureWidth = width;
_pictureHeight = height;
_busWidth = busWidth;
_busHeight = busHeight;
EntityBus = new EntityBus(speed, weight, bodyColor);
}
public void SetPosition(int x, int y)
{
if (_pictureWidth <= _busWidth || _pictureHeight <= _busHeight)
{
_pictureWidth = null;
_pictureHeight = null;
return;
}
_startPosX = x;
_startPosY = y;
}
public bool CanMove(DirectionBus direction)
{
if (EntityBus == null)
{
return false;
}
return direction switch
{
//влево
DirectionBus.Left => _startPosX - EntityBus.Step > 0,
//вверх
DirectionBus.Up => _startPosY - EntityBus.Step > 0,
//вправо
DirectionBus.Right => _startPosX + _busWidth + EntityBus.Step < _pictureWidth,
//вниз
DirectionBus.Down => _startPosY + _busHeight + EntityBus.Step < _pictureHeight,
_ => false,
};
}
public void MoveTransport(DirectionBus direction)
{
if (!CanMove(direction) || EntityBus == null)
{
return;
}
switch (direction)
{
//влево
case DirectionBus.Left:
_startPosX -= (int)EntityBus.Step;
break;
//вверх
case DirectionBus.Up:
_startPosY -= (int)EntityBus.Step;
break;
// вправо
case DirectionBus.Right:
_startPosX += (int)EntityBus.Step;
break;
//вниз
case DirectionBus.Down:
_startPosY += (int)EntityBus.Step;
break;
}
}
public virtual void DrawTransport(Graphics g)
{
if (EntityBus == null)
{
return;
}
if (EntityBus == null)
{
return;
}
Pen pen = new(Color.Black);
g.DrawRectangle(pen, _startPosX - 1, _startPosY + 11, 100, 30);
Brush brBodyColor = new SolidBrush(EntityBus.BodyColor);
g.FillRectangle(brBodyColor, _startPosX, _startPosY + 10, 100, 30);
g.DrawRectangle(pen, _startPosX + 30, _startPosY + 20, 10, 20);
Brush brBlack = new SolidBrush(Color.Black);
g.FillRectangle(brBlack, _startPosX + 30, _startPosY + 20, 10, 20);
g.DrawEllipse(pen, _startPosX + 7, _startPosY + 35, 10, 10);
g.DrawEllipse(pen, _startPosX + 77, _startPosY + 35, 10, 10);
g.FillEllipse(brBlack, _startPosX + 7, _startPosY + 35, 10, 10);
g.FillEllipse(brBlack, _startPosX + 77, _startPosY + 35, 10, 10);
Brush brBlue = new SolidBrush(Color.Blue);
g.FillEllipse(brBlue, _startPosX + 10, _startPosY + 15, 10, 15);
g.FillEllipse(brBlue, _startPosX + 50, _startPosY + 15, 10, 15);
g.FillEllipse(brBlue, _startPosX + 70, _startPosY + 15, 10, 15);
g.FillEllipse(brBlue, _startPosX + 90, _startPosY + 15, 10, 15);
}
}
}

View File

@ -1,78 +0,0 @@
using DoubleDeckerBus.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net.NetworkInformation;
namespace DoubleDeckerBus.DrawningObjects
{
public class DrawningDoubleDeckerBus : DrawningBus
{
public DrawningDoubleDeckerBus(int speed, float weight, Color bodyColor,
Color additionalColor, bool secondFloor, bool ladder, bool lineBetweenFloor, int width, int height) :
base(speed, weight, bodyColor, width, height, 120, 85)
{
if (EntityBus != null)
{
EntityBus = new EntityDoubleDeckerBus(speed, weight, bodyColor,
additionalColor, secondFloor, ladder, lineBetweenFloor);
}
}
public override void DrawTransport(Graphics g)
{
if (EntityBus is not EntityDoubleDeckerBus doubleDeckerBus)
{
return;
}
Pen pen = new(Color.Black);
Brush brAdditionalColor = new SolidBrush(doubleDeckerBus.AdditionalColor);
Brush brBlue = new SolidBrush(Color.Blue);
Brush brBlack = new SolidBrush(Color.Black);
if (doubleDeckerBus.SecondFloor)
{
g.FillRectangle(brAdditionalColor, _startPosX, _startPosY + 10, 100, 30);
g.DrawRectangle(pen, _startPosX + 30, _startPosY + 20, 10, 20);
g.FillRectangle(brBlack, _startPosX + 30, _startPosY + 20, 10, 20);
g.FillEllipse(brBlue, _startPosX + 10, _startPosY + 15, 10, 15);
g.FillEllipse(brBlue, _startPosX + 50, _startPosY + 15, 10, 15);
g.FillEllipse(brBlue, _startPosX + 70, _startPosY + 15, 10, 15);
g.FillEllipse(brBlue, _startPosX + 90, _startPosY + 15, 10, 15);
}
_startPosY += 30;
base.DrawTransport(g);
_startPosY -= 30;
if (doubleDeckerBus.Ladder)
{
if (doubleDeckerBus.SecondFloor == true)
{
//Вертикальные прямые
g.DrawLine(pen, new Point((int)(_startPosX), (int)(_startPosY + 70)), new Point((int)(_startPosX), (int)(_startPosY + 10)));
g.DrawLine(pen, new Point((int)(_startPosX + 10), (int)(_startPosY + 70)), new Point((int)(_startPosX + 10), (int)(_startPosY + 10)));
//Горизонтальные прямые
g.DrawLine(pen, new Point((int)(_startPosX), (int)(_startPosY + 20)), new Point((int)(_startPosX + 10), (int)(_startPosY + 20)));
g.DrawLine(pen, new Point((int)(_startPosX), (int)(_startPosY + 30)), new Point((int)(_startPosX + 10), (int)(_startPosY + 30)));
g.DrawLine(pen, new Point((int)(_startPosX), (int)(_startPosY + 40)), new Point((int)(_startPosX + 10), (int)(_startPosY + 40)));
g.DrawLine(pen, new Point((int)(_startPosX), (int)(_startPosY + 50)), new Point((int)(_startPosX + 10), (int)(_startPosY + 50)));
g.DrawLine(pen, new Point((int)(_startPosX), (int)(_startPosY + 60)), new Point((int)(_startPosX + 10), (int)(_startPosY + 60)));
}
}
}
}
}

View File

@ -1,24 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DoubleDeckerBus.Entities
{
public class EntityBus
{
public int Speed { get; private set; }
public double Weight { get; private set; }
public Color BodyColor { get; private set; }
public double Step => (double)Speed * 100 / Weight;
public EntityBus(int speed, double weight, Color bodyColor)
{
Speed = speed;
Weight = weight;
BodyColor = bodyColor;
}
}
}

View File

@ -1,26 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DoubleDeckerBus.Entities
{
public class EntityDoubleDeckerBus : EntityBus
{
public Color AdditionalColor { get; private set; }
public bool SecondFloor { get; private set; }
public bool Ladder { get; private set; }
public bool LineBetweenFloor { get; private set; }
public EntityDoubleDeckerBus(int speed, double weight, Color bodyColor, Color
additionalColor, bool secondFloor, bool ladder, bool lineBetweenFloor) :
base(speed, weight, bodyColor)
{
AdditionalColor = additionalColor;
SecondFloor = secondFloor;
Ladder = ladder;
LineBetweenFloor = lineBetweenFloor;
}
}
}

View File

@ -1,129 +0,0 @@
namespace DoubleDeckerBus
{
partial class FormBusCollection
{
/// <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()
{
buttonAddBus = new Button();
buttonRemoveBus = new Button();
ButtonRefreshCollection = new Button();
maskedTextBoxNumber = new MaskedTextBox();
pictureBoxCollection = new PictureBox();
panel = new Panel();
((System.ComponentModel.ISupportInitialize)pictureBoxCollection).BeginInit();
panel.SuspendLayout();
SuspendLayout();
//
// buttonAddBus
//
buttonAddBus.Anchor = AnchorStyles.Top | AnchorStyles.Right;
buttonAddBus.Location = new Point(14, 3);
buttonAddBus.Name = "buttonAddBus";
buttonAddBus.Size = new Size(138, 31);
buttonAddBus.TabIndex = 0;
buttonAddBus.Text = "Добавить автобус";
buttonAddBus.UseVisualStyleBackColor = true;
buttonAddBus.Click += buttonAddBus_Click;
//
// buttonRemoveBus
//
buttonRemoveBus.Anchor = AnchorStyles.Top | AnchorStyles.Right;
buttonRemoveBus.Location = new Point(14, 69);
buttonRemoveBus.Name = "buttonRemoveBus";
buttonRemoveBus.Size = new Size(138, 31);
buttonRemoveBus.TabIndex = 1;
buttonRemoveBus.Text = "Удалить автобус";
buttonRemoveBus.UseVisualStyleBackColor = true;
buttonRemoveBus.Click += buttonRemoveBus_Click;
//
// ButtonRefreshCollection
//
ButtonRefreshCollection.Anchor = AnchorStyles.Top | AnchorStyles.Right;
ButtonRefreshCollection.Location = new Point(14, 106);
ButtonRefreshCollection.Name = "ButtonRefreshCollection";
ButtonRefreshCollection.Size = new Size(138, 31);
ButtonRefreshCollection.TabIndex = 2;
ButtonRefreshCollection.Text = "Обновить коллекцию";
ButtonRefreshCollection.UseVisualStyleBackColor = true;
ButtonRefreshCollection.Click += ButtonRefreshCollection_Click;
//
// maskedTextBoxNumber
//
maskedTextBoxNumber.Anchor = AnchorStyles.Top | AnchorStyles.Right;
maskedTextBoxNumber.Location = new Point(14, 40);
maskedTextBoxNumber.Name = "maskedTextBoxNumber";
maskedTextBoxNumber.Size = new Size(138, 23);
maskedTextBoxNumber.TabIndex = 3;
maskedTextBoxNumber.Text = "_";
//
// pictureBoxCollection
//
pictureBoxCollection.Location = new Point(2, 2);
pictureBoxCollection.Name = "pictureBoxCollection";
pictureBoxCollection.Size = new Size(703, 457);
pictureBoxCollection.TabIndex = 4;
pictureBoxCollection.TabStop = false;
//
// panel
//
panel.Anchor = AnchorStyles.Top | AnchorStyles.Right;
panel.Controls.Add(buttonAddBus);
panel.Controls.Add(maskedTextBoxNumber);
panel.Controls.Add(ButtonRefreshCollection);
panel.Controls.Add(buttonRemoveBus);
panel.Location = new Point(721, 2);
panel.Name = "panel";
panel.Size = new Size(162, 460);
panel.TabIndex = 5;
panel.Tag = "";
//
// FormBusCollection
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(884, 461);
Controls.Add(panel);
Controls.Add(pictureBoxCollection);
Name = "FormBusCollection";
Text = "Набор автобусов";
((System.ComponentModel.ISupportInitialize)pictureBoxCollection).EndInit();
panel.ResumeLayout(false);
panel.PerformLayout();
ResumeLayout(false);
}
#endregion
private Button buttonAddBus;
private Button buttonRemoveBus;
private Button button3;
private MaskedTextBox maskedTextBoxNumber;
private PictureBox pictureBoxCollection;
private Button ButtonRefreshCollection;
private Panel panel;
}
}

View File

@ -1,64 +0,0 @@
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;
using DoubleDeckerBus.DrawningObjects;
using DoubleDeckerBus.Generics;
using DoubleDeckerBus.MovementStrategy;
namespace DoubleDeckerBus
{
public partial class FormBusCollection : Form
{
private readonly BusesGenericCollection<DrawningBus, DrawningObjectBus> _buses;
public FormBusCollection()
{
InitializeComponent();
_buses = new BusesGenericCollection<DrawningBus, DrawningObjectBus>
(pictureBoxCollection.Width, pictureBoxCollection.Height);
}
private void buttonAddBus_Click(object sender, EventArgs e)
{
DoubleDeckerBus form = new();
if (form.ShowDialog() == DialogResult.OK)
{
if (_buses + form.SelectedBus != -1)
{
MessageBox.Show("Объект добавлен");
pictureBoxCollection.Image = _buses.ShowBuses();
}
else
{
MessageBox.Show("Не удалось добавить объект");
}
}
}
private void buttonRemoveBus_Click(object sender, EventArgs e)
{
if (MessageBox.Show("Удалить объект?", "Удаление",
MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
{
return;
}
int pos = Convert.ToInt32(maskedTextBoxNumber.Text);
if (_buses - pos != null)
{
MessageBox.Show("Объект удален");
pictureBoxCollection.Image = _buses.ShowBuses();
}
else
{
MessageBox.Show("Не удалось удалить объект");
}
}
private void ButtonRefreshCollection_Click(object sender, EventArgs e)
{
pictureBoxCollection.Image = _buses.ShowBuses();
}
}
}

View File

@ -1,120 +0,0 @@
<?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>
</root>

View File

@ -1,87 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DoubleDeckerBus.DrawningObjects;
using DoubleDeckerBus.MovementStrategy;
namespace DoubleDeckerBus.Generics
{
internal class BusesGenericCollection<T, U>
where T : DrawningBus
where U : IMoveableObject
{
private readonly int _pictureWidth;
private readonly int _pictureHeight;
private readonly int _placeSizeWidth = 210;
private readonly int _placeSizeHeight = 90;
private readonly SetGeneric<T> _collection;
public BusesGenericCollection(int picWidth, int picHeight)
{
int width = picWidth / _placeSizeWidth;
int height = picHeight / _placeSizeHeight;
_pictureWidth = picWidth;
_pictureHeight = picHeight;
_collection = new SetGeneric<T>(width * height);
}
public static int operator +(BusesGenericCollection<T, U> collect, T? obj)
{
if (obj == null)
{
return -1;
}
return collect?._collection.Insert(obj) ?? -1;
}
public static bool operator -(BusesGenericCollection<T, U> collect, int pos)
{
T? obj = collect._collection.Get(pos);
if (obj != null)
{
collect._collection.Remove(pos);
return true;
}
return false;
}
public U? GetU(int pos)
{
return (U?)_collection.Get(pos)?.GetMoveableObject;
}
public Bitmap ShowBuses()
{
Bitmap bmp = new(_pictureWidth, _pictureHeight);
Graphics gr = Graphics.FromImage(bmp);
DrawBackground(gr);
DrawObjects(gr);
return bmp;
}
private void DrawBackground(Graphics g)
{
Pen pen = new(Color.Black, 3);
for (int i = 0; i < _pictureWidth / _placeSizeWidth; i++)
{
for (int j = 0; j < _pictureHeight / _placeSizeHeight + 1; ++j)
{//линия рамзетки места
g.DrawLine(pen, i * _placeSizeWidth, j * _placeSizeHeight, i * _placeSizeWidth + _placeSizeWidth / 2, j * _placeSizeHeight);
}
g.DrawLine(pen, i * _placeSizeWidth, 0, i * _placeSizeWidth, _pictureHeight / _placeSizeHeight * _placeSizeHeight);
}
}
private void DrawObjects(Graphics g)
{
int widthObjCount = _pictureWidth / _placeSizeWidth;
for (int i = 0; i < _collection.Count; i++)
{
T? type = _collection.Get(i);
if (type != null)
{
int row = i / widthObjCount;
int col = widthObjCount - 1 - (i % widthObjCount);
type.SetPosition(col * _placeSizeWidth, row * _placeSizeHeight);
type?.DrawTransport(g);
}
}
}
}
}

View File

@ -1,71 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;
namespace DoubleDeckerBus.Generics
{
internal class SetGeneric<T>
where T : class
{
private readonly T?[] _places;
public int Count => _places.Length;
public SetGeneric(int count)
{
_places = new T?[count];
}
public int Insert(T bus)
{
return Insert(bus, 0);
}
public int Insert(T bus, int position)
{
int NoEmpty = 0, temp = 0;
for (int i = position; i < Count; i++)
{
if (_places[i] != null) NoEmpty++;
}
if (NoEmpty == Count - position - 1) return -1;
if (position < Count && position >= 0)
{
for (int j = position; j < Count; j++)
{
if (_places[j] == null)
{
temp = j;
break;
}
}
for (int i = temp; i > position; i--)
{
_places[i] = _places[i - 1];
}
_places[position] = bus;
return position;
}
return -1;
}
public bool Remove(int position)
{
if (position < 0 || position >= Count)
{
return false;
}
_places[position] = null;
return true;
}
public T? Get(int position)
{
if (position < 0 || position >= _places.Length)
{
return null;
}
return _places[position];
}
}
}

View File

@ -1,72 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DoubleDeckerBus.MovementStrategy
{
public abstract class AbstractStrategy
{
private IMoveableObject? _moveableObject;
private Status _state = Status.NotInit;
protected int FieldWidth { get; private set; }
protected int FieldHeight { get; private set; }
public Status GetStatus() { return _state; }
public void SetData(IMoveableObject moveableObject, int width, int
height)
{
if (moveableObject == null)
{
_state = Status.NotInit;
return;
}
_state = Status.InProgress;
_moveableObject = moveableObject;
FieldWidth = width;
FieldHeight = height;
}
public void MakeStep()
{
if (_state != Status.InProgress)
{
return;
}
if (IsTargetDestinaion())
{
_state = Status.Finish;
return;
}
MoveToTarget();
}
protected bool MoveLeft() => MoveTo(DirectionBus.Left);
protected bool MoveRight() => MoveTo(DirectionBus.Right);
protected bool MoveUp() => MoveTo(DirectionBus.Up);
protected bool MoveDown() => MoveTo(DirectionBus.Down);
protected ObjectParameters? GetObjectParameters =>
_moveableObject?.GetObjectPosition;
protected int? GetStep()
{
if (_state != Status.InProgress)
{
return null;
}
return _moveableObject?.GetStep;
}
protected abstract void MoveToTarget();
protected abstract bool IsTargetDestinaion();
private bool MoveTo(DirectionBus directionType)
{
if (_state != Status.InProgress)
{
return false;
}
if (_moveableObject?.CheckCanMove(directionType) ?? false)
{
_moveableObject.MoveObject(directionType);
return true;
}
return false;
}
}
}

View File

@ -1,40 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DoubleDeckerBus.DrawningObjects;
namespace DoubleDeckerBus.MovementStrategy
{
public class DrawningObjectBus : IMoveableObject
{
private readonly DrawningBus? _drawningBus = null;
public DrawningObjectBus(DrawningBus drawningBus)
{
_drawningBus = drawningBus;
}
public ObjectParameters? GetObjectPosition
{
get
{
if (_drawningBus == null || _drawningBus.EntityBus == null)
{
return null;
}
return new ObjectParameters(_drawningBus.GetPosX,
_drawningBus.GetPosY, _drawningBus.GetWidth, _drawningBus.GetHeight);
}
}
public int GetStep => (int)(_drawningBus?.EntityBus?.Step ?? 0);
public bool CheckCanMove(DirectionBus direction) =>
_drawningBus?.CanMove(direction) ?? false;
public void MoveObject(DirectionBus direction) =>
_drawningBus?.MoveTransport(direction);
}
}

View File

@ -1,16 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DoubleDeckerBus.MovementStrategy
{
public interface IMoveableObject
{
ObjectParameters? GetObjectPosition { get; }
int GetStep { get; }
bool CheckCanMove(DirectionBus direction);
void MoveObject(DirectionBus direction);
}
}

View File

@ -1,58 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DoubleDeckerBus.MovementStrategy
{
public class MoveToBorder : AbstractStrategy
{
protected override bool IsTargetDestinaion()
{
var objParams = GetObjectParameters;
if (objParams == null)
{
return false;
}
return objParams.RightBorder <= FieldWidth &&
objParams.RightBorder + GetStep() >= FieldWidth &&
objParams.DownBorder <= FieldHeight &&
objParams.DownBorder + GetStep() >= FieldHeight;
}
protected override void MoveToTarget()
{
var objParams = GetObjectParameters;
if (objParams == null)
{
return;
}
var diffX = objParams.RightBorder - FieldWidth;
if (Math.Abs(diffX) > GetStep())
{
if (diffX > 0)
{
MoveLeft();
}
else
{
MoveRight();
}
}
var diffY = objParams.DownBorder - FieldHeight;
if (Math.Abs(diffY) > GetStep())
{
if (diffY > 0)
{
MoveUp();
}
else
{
MoveDown();
}
}
}
}
}

View File

@ -1,57 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DoubleDeckerBus.MovementStrategy
{
public class MoveToCenter : AbstractStrategy
{
protected override bool IsTargetDestinaion()
{
var objParams = GetObjectParameters;
if (objParams == null)
{
return false;
}
return objParams.ObjectMiddleHorizontal <= FieldWidth / 2 &&
objParams.ObjectMiddleHorizontal + GetStep() >= FieldWidth / 2 &&
objParams.ObjectMiddleVertical <= FieldHeight / 2 &&
objParams.ObjectMiddleVertical + GetStep() >= FieldHeight / 2;
}
protected override void MoveToTarget()
{
var objParams = GetObjectParameters;
if (objParams == null)
{
return;
}
var diffX = objParams.ObjectMiddleHorizontal - FieldWidth / 2;
if (Math.Abs(diffX) > GetStep())
{
if (diffX > 0)
{
MoveLeft();
}
else
{
MoveRight();
}
}
var diffY = objParams.ObjectMiddleVertical - FieldHeight / 2;
if (Math.Abs(diffY) > GetStep())
{
if (diffY > 0)
{
MoveUp();
}
else
{
MoveDown();
}
}
}
}
}

View File

@ -1,30 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DoubleDeckerBus.MovementStrategy
{
public class ObjectParameters
{
private readonly int _x;
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)
{
_x = x;
_y = y;
_width = width;
_height = height;
}
}
}

View File

@ -1,15 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DoubleDeckerBus.MovementStrategy
{
public enum Status
{
NotInit,
InProgress,
Finish
}
}

View File

@ -1,14 +0,0 @@
using System.Drawing;
namespace DoubleDeckerBus
{
internal static class Program
{
[STAThread]
static void Main()
{
ApplicationConfiguration.Initialize();
Application.Run(new FormBusCollection());
}
}
}

View File

@ -1,103 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Этот код создан программой.
// Исполняемая версия:4.0.30319.42000
//
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
// повторной генерации кода.
// </auto-generated>
//------------------------------------------------------------------------------
namespace DoubleDeckerBus.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("DoubleDeckerBus.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;
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap arrowDown {
get {
object obj = ResourceManager.GetObject("arrowDown", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap arrowLeft {
get {
object obj = ResourceManager.GetObject("arrowLeft", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap arrowRight {
get {
object obj = ResourceManager.GetObject("arrowRight", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap arrowUp {
get {
object obj = ResourceManager.GetObject("arrowUp", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

View File

@ -1,133 +0,0 @@
<?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.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="arrowUp" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\arrowUp.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="arrowLeft" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\arrowLeft.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="arrowDown" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\arrowDown.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="arrowRight" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\arrowRight.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB