Удаление лишних файлов
This commit is contained in:
parent
85cf4068b2
commit
b2b2531af1
@ -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}") = "Kursach", "Kursach\Kursach.csproj", "{F7A92B07-FEB7-46DF-95FA-0942077ADE41}"
|
|
||||||
EndProject
|
|
||||||
Global
|
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
||||||
Debug|Any CPU = Debug|Any CPU
|
|
||||||
Release|Any CPU = Release|Any CPU
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
|
||||||
{F7A92B07-FEB7-46DF-95FA-0942077ADE41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{F7A92B07-FEB7-46DF-95FA-0942077ADE41}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{F7A92B07-FEB7-46DF-95FA-0942077ADE41}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{F7A92B07-FEB7-46DF-95FA-0942077ADE41}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
|
||||||
HideSolutionNode = FALSE
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
|
||||||
SolutionGuid = {0F654BCD-A24D-4152-A016-59A66A97ADC9}
|
|
||||||
EndGlobalSection
|
|
||||||
EndGlobal
|
|
@ -1,55 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Kursach
|
|
||||||
{
|
|
||||||
public class Deque
|
|
||||||
{
|
|
||||||
public LinkedList<int>? list;
|
|
||||||
|
|
||||||
public int numElems;
|
|
||||||
|
|
||||||
public Deque()
|
|
||||||
{
|
|
||||||
list = new LinkedList<int>();
|
|
||||||
numElems = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void InsertFirst(int value)
|
|
||||||
{
|
|
||||||
list.AddFirst(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void InsertLast(int value)
|
|
||||||
{
|
|
||||||
list.AddLast(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int PopFirst()
|
|
||||||
{
|
|
||||||
int temp = list.getHead();
|
|
||||||
list.RemoveFirst();
|
|
||||||
return temp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int PopLast()
|
|
||||||
{
|
|
||||||
int temp = list.getTail();
|
|
||||||
list.RemoveLast();
|
|
||||||
return temp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool isEmpty()
|
|
||||||
{
|
|
||||||
return list.IsEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Clear()
|
|
||||||
{
|
|
||||||
list.Clear();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
145
Kursach/Kursach/Form1.Designer.cs
generated
145
Kursach/Kursach/Form1.Designer.cs
generated
@ -1,145 +0,0 @@
|
|||||||
namespace Kursach
|
|
||||||
{
|
|
||||||
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()
|
|
||||||
{
|
|
||||||
textBoxInput = new TextBox();
|
|
||||||
buttonAddFirst = new Button();
|
|
||||||
buttonAddLast = new Button();
|
|
||||||
buttonDelFirst = new Button();
|
|
||||||
buttonDelLast = new Button();
|
|
||||||
buttonClear = new Button();
|
|
||||||
button = new Button();
|
|
||||||
groupBoxControls = new GroupBox();
|
|
||||||
groupBoxControls.SuspendLayout();
|
|
||||||
SuspendLayout();
|
|
||||||
//
|
|
||||||
// textBoxInput
|
|
||||||
//
|
|
||||||
textBoxInput.Location = new Point(6, 30);
|
|
||||||
textBoxInput.Name = "textBoxInput";
|
|
||||||
textBoxInput.Size = new Size(333, 31);
|
|
||||||
textBoxInput.TabIndex = 0;
|
|
||||||
//
|
|
||||||
// buttonAddFirst
|
|
||||||
//
|
|
||||||
buttonAddFirst.Location = new Point(6, 67);
|
|
||||||
buttonAddFirst.Name = "buttonAddFirst";
|
|
||||||
buttonAddFirst.Size = new Size(104, 62);
|
|
||||||
buttonAddFirst.TabIndex = 1;
|
|
||||||
buttonAddFirst.Text = "Добавить в начало";
|
|
||||||
buttonAddFirst.UseVisualStyleBackColor = true;
|
|
||||||
//
|
|
||||||
// buttonAddLast
|
|
||||||
//
|
|
||||||
buttonAddLast.Location = new Point(116, 67);
|
|
||||||
buttonAddLast.Name = "buttonAddLast";
|
|
||||||
buttonAddLast.Size = new Size(104, 62);
|
|
||||||
buttonAddLast.TabIndex = 2;
|
|
||||||
buttonAddLast.Text = "Добавить в конец";
|
|
||||||
buttonAddLast.UseVisualStyleBackColor = true;
|
|
||||||
//
|
|
||||||
// buttonDelFirst
|
|
||||||
//
|
|
||||||
buttonDelFirst.Location = new Point(253, 67);
|
|
||||||
buttonDelFirst.Name = "buttonDelFirst";
|
|
||||||
buttonDelFirst.Size = new Size(104, 62);
|
|
||||||
buttonDelFirst.TabIndex = 3;
|
|
||||||
buttonDelFirst.Text = "Извлечь из начала";
|
|
||||||
buttonDelFirst.UseVisualStyleBackColor = true;
|
|
||||||
//
|
|
||||||
// buttonDelLast
|
|
||||||
//
|
|
||||||
buttonDelLast.Location = new Point(363, 67);
|
|
||||||
buttonDelLast.Name = "buttonDelLast";
|
|
||||||
buttonDelLast.Size = new Size(104, 62);
|
|
||||||
buttonDelLast.TabIndex = 4;
|
|
||||||
buttonDelLast.Text = "Извлечь из конца";
|
|
||||||
buttonDelLast.UseVisualStyleBackColor = true;
|
|
||||||
//
|
|
||||||
// buttonClear
|
|
||||||
//
|
|
||||||
buttonClear.Location = new Point(497, 67);
|
|
||||||
buttonClear.Name = "buttonClear";
|
|
||||||
buttonClear.Size = new Size(104, 62);
|
|
||||||
buttonClear.TabIndex = 5;
|
|
||||||
buttonClear.Text = "Очистить очередь";
|
|
||||||
buttonClear.UseVisualStyleBackColor = true;
|
|
||||||
//
|
|
||||||
// button
|
|
||||||
//
|
|
||||||
button.BackColor = Color.FromArgb(192, 0, 0);
|
|
||||||
button.Location = new Point(607, 67);
|
|
||||||
button.Name = "button";
|
|
||||||
button.Size = new Size(104, 62);
|
|
||||||
button.TabIndex = 6;
|
|
||||||
button.Text = "Очистить очередь";
|
|
||||||
button.UseVisualStyleBackColor = false;
|
|
||||||
//
|
|
||||||
// groupBoxControls
|
|
||||||
//
|
|
||||||
groupBoxControls.Controls.Add(textBoxInput);
|
|
||||||
groupBoxControls.Controls.Add(button);
|
|
||||||
groupBoxControls.Controls.Add(buttonAddFirst);
|
|
||||||
groupBoxControls.Controls.Add(buttonClear);
|
|
||||||
groupBoxControls.Controls.Add(buttonAddLast);
|
|
||||||
groupBoxControls.Controls.Add(buttonDelLast);
|
|
||||||
groupBoxControls.Controls.Add(buttonDelFirst);
|
|
||||||
groupBoxControls.Dock = DockStyle.Top;
|
|
||||||
groupBoxControls.Location = new Point(0, 0);
|
|
||||||
groupBoxControls.Name = "groupBoxControls";
|
|
||||||
groupBoxControls.Size = new Size(800, 146);
|
|
||||||
groupBoxControls.TabIndex = 7;
|
|
||||||
groupBoxControls.TabStop = false;
|
|
||||||
groupBoxControls.Text = "АТД дек";
|
|
||||||
//
|
|
||||||
// Form1
|
|
||||||
//
|
|
||||||
AutoScaleDimensions = new SizeF(10F, 25F);
|
|
||||||
AutoScaleMode = AutoScaleMode.Font;
|
|
||||||
ClientSize = new Size(800, 568);
|
|
||||||
Controls.Add(groupBoxControls);
|
|
||||||
Name = "Form1";
|
|
||||||
Text = "Form1";
|
|
||||||
groupBoxControls.ResumeLayout(false);
|
|
||||||
groupBoxControls.PerformLayout();
|
|
||||||
ResumeLayout(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
private TextBox textBoxInput;
|
|
||||||
private Button buttonAddFirst;
|
|
||||||
private Button buttonAddLast;
|
|
||||||
private Button buttonDelFirst;
|
|
||||||
private Button buttonDelLast;
|
|
||||||
private Button buttonClear;
|
|
||||||
private Button button;
|
|
||||||
private GroupBox groupBoxControls;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
namespace Kursach
|
|
||||||
{
|
|
||||||
public partial class Form1 : Form
|
|
||||||
{
|
|
||||||
public Form1()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -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>
|
|
@ -1,12 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<OutputType>WinExe</OutputType>
|
|
||||||
<TargetFramework>net7.0-windows</TargetFramework>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
<UseWindowsForms>true</UseWindowsForms>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
@ -1,138 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Kursach
|
|
||||||
{
|
|
||||||
|
|
||||||
public class LinkedList<T>
|
|
||||||
{
|
|
||||||
private Node<T>? head;
|
|
||||||
private Node<T>? tail;
|
|
||||||
private int numElems;
|
|
||||||
public LinkedList()
|
|
||||||
{
|
|
||||||
head = null;
|
|
||||||
tail = null;
|
|
||||||
numElems = 0;
|
|
||||||
}
|
|
||||||
public void AddLast(T value)
|
|
||||||
{
|
|
||||||
Node<T> node = new Node<T>(value);
|
|
||||||
if (head == null)
|
|
||||||
{
|
|
||||||
head = node;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
tail.next = node;
|
|
||||||
}
|
|
||||||
tail = node;
|
|
||||||
numElems++;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void AddFirst(T value)
|
|
||||||
{
|
|
||||||
Node<T> node = new Node<T>(value);
|
|
||||||
if (numElems == 0)
|
|
||||||
{
|
|
||||||
head = node;
|
|
||||||
tail = head;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
node.next = head;
|
|
||||||
}
|
|
||||||
head = node;
|
|
||||||
numElems++;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool RemoveFirst()
|
|
||||||
{
|
|
||||||
if (head == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (head == tail)
|
|
||||||
{
|
|
||||||
head = tail = null;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
head = head.next;
|
|
||||||
}
|
|
||||||
numElems--;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
public bool RemoveLast()
|
|
||||||
{
|
|
||||||
if (head == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (head == tail)
|
|
||||||
{
|
|
||||||
head = tail = null;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Node<T>? prev = null;
|
|
||||||
Node<T>? curr = head;
|
|
||||||
while (curr.next != null)
|
|
||||||
{
|
|
||||||
prev = curr;
|
|
||||||
curr = curr.next;
|
|
||||||
}
|
|
||||||
|
|
||||||
tail = prev;
|
|
||||||
tail.next = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
numElems--;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
public bool Contains(T value)
|
|
||||||
{
|
|
||||||
Node<T>? curr = head;
|
|
||||||
while (curr != null)
|
|
||||||
{
|
|
||||||
if (curr.data.Equals(value))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
curr = curr.next;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
public void Clear()
|
|
||||||
{
|
|
||||||
head = null;
|
|
||||||
tail = null;
|
|
||||||
numElems = 0;
|
|
||||||
}
|
|
||||||
public bool IsEmpty()
|
|
||||||
{
|
|
||||||
return numElems==0;
|
|
||||||
}
|
|
||||||
public T getHead()
|
|
||||||
{
|
|
||||||
return head.data;
|
|
||||||
}
|
|
||||||
public T getTail()
|
|
||||||
{
|
|
||||||
return tail.data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
unsafe public class Node<T>
|
|
||||||
{
|
|
||||||
public Node<T> next { get; set; }
|
|
||||||
public T data { get; set; }
|
|
||||||
public Node(T data)
|
|
||||||
{
|
|
||||||
this.data = data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
namespace Kursach
|
|
||||||
{
|
|
||||||
internal static class Program
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The main entry point for the application.
|
|
||||||
/// </summary>
|
|
||||||
[STAThread]
|
|
||||||
static void Main()
|
|
||||||
{
|
|
||||||
// To customize application configuration such as set high DPI settings or default font,
|
|
||||||
// see https://aka.ms/applicationconfiguration.
|
|
||||||
ApplicationConfiguration.Initialize();
|
|
||||||
Application.Run(new Form1());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -25,15 +25,17 @@ where T : class
|
|||||||
/// Добавление объекта в коллекцию
|
/// Добавление объекта в коллекцию
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="obj">Добавляемый объект</param>
|
/// <param name="obj">Добавляемый объект</param>
|
||||||
|
/// <param name="comparer"> Сравнение двух объектов </param>
|
||||||
/// <returns>true - вставка прошла удачно, false - вставка не удалась</returns>
|
/// <returns>true - вставка прошла удачно, false - вставка не удалась</returns>
|
||||||
int Insert(T obj);
|
int Insert(T obj, IEqualityComparer<T?>? comparer = null);
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Добавление объекта в коллекцию на конкретную позицию
|
/// Добавление объекта в коллекцию на конкретную позицию
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="obj">Добавляемый объект</param>
|
/// <param name="obj">Добавляемый объект</param>
|
||||||
|
// <param name="comparer"> Сравнение двух объектов </param>
|
||||||
/// <param name="position">Позиция</param>
|
/// <param name="position">Позиция</param>
|
||||||
/// <returns>true - вставка прошла удачно, false - вставка не удалась</returns>
|
/// <returns>true - вставка прошла удачно, false - вставка не удалась</returns>
|
||||||
int Insert(T obj, int position);
|
int Insert(T obj, int position, IEqualityComparer<T?>? comparer = null);
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Удаление объекта из коллекции с конкретной позиции
|
/// Удаление объекта из коллекции с конкретной позиции
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -48,13 +48,13 @@ public class ListGenericObjects<T> : ICollectionGenericObjects<T>
|
|||||||
if (_collection[position] == null) throw new ObjectNotFoundException();
|
if (_collection[position] == null) throw new ObjectNotFoundException();
|
||||||
return _collection[position];
|
return _collection[position];
|
||||||
}
|
}
|
||||||
public int Insert(T obj)
|
public int Insert(T obj, IEqualityComparer<T?>? comparer = null)
|
||||||
{
|
{
|
||||||
if (Count == _maxCount) throw new CollectionOverflowException(Count);
|
if (Count == _maxCount) throw new CollectionOverflowException(Count);
|
||||||
_collection.Add(obj);
|
_collection.Add(obj);
|
||||||
return Count;
|
return Count;
|
||||||
}
|
}
|
||||||
public int Insert(T obj, int position)
|
public int Insert(T obj, int position, IEqualityComparer<T?>? comparer = null)
|
||||||
{
|
{
|
||||||
if (Count == _maxCount) throw new CollectionOverflowException(Count);
|
if (Count == _maxCount) throw new CollectionOverflowException(Count);
|
||||||
if (position >= Count || position < 0) throw new PositionOutOfCollectionException(position);
|
if (position >= Count || position < 0) throw new PositionOutOfCollectionException(position);
|
||||||
|
@ -52,7 +52,7 @@ public class MassiveGenericObjects<T> : ICollectionGenericObjects<T>
|
|||||||
if (position < 0 || position >= Count) throw new PositionOutOfCollectionException();
|
if (position < 0 || position >= Count) throw new PositionOutOfCollectionException();
|
||||||
return _collection[position];
|
return _collection[position];
|
||||||
}
|
}
|
||||||
public int Insert(T obj)
|
public int Insert(T obj, IEqualityComparer<T?>? comparer = null)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < Count; i++)
|
for (int i = 0; i < Count; i++)
|
||||||
{
|
{
|
||||||
@ -64,7 +64,7 @@ public class MassiveGenericObjects<T> : ICollectionGenericObjects<T>
|
|||||||
}
|
}
|
||||||
throw new CollectionOverflowException();
|
throw new CollectionOverflowException();
|
||||||
}
|
}
|
||||||
public int Insert(T obj, int position)
|
public int Insert(T obj, int position, IEqualityComparer<T?>? comparer = null)
|
||||||
{
|
{
|
||||||
if (position < 0 || position >= Count)
|
if (position < 0 || position >= Count)
|
||||||
{
|
{
|
||||||
|
@ -0,0 +1,64 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
using ProjectLinkor.Entities;
|
||||||
|
|
||||||
|
namespace ProjectLinkor.Drawnings;
|
||||||
|
|
||||||
|
public class DrawingShipEqutables : IEqualityComparer<DrawingShip?>
|
||||||
|
{
|
||||||
|
public bool Equals(DrawingShip? x, DrawingShip? y)
|
||||||
|
{
|
||||||
|
if (ReferenceEquals(x, null)) return false;
|
||||||
|
if (ReferenceEquals(y, null)) return false;
|
||||||
|
if (x.GetType() != y.GetType()) return false;
|
||||||
|
|
||||||
|
if (x.GetType().Name != y.GetType().Name)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (x.EntityShip != null && y.EntityShip != null && x.EntityShip.Speed != y.EntityShip.Speed)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (x.EntityShip.Weight != y.EntityShip.Weight)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (x.EntityShip.BodyColor != y.EntityShip.BodyColor)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (x is DrawingLinkor && y is DrawingLinkor)
|
||||||
|
{
|
||||||
|
if (((EntityLinkor)x.EntityShip).AdditionalColor !=
|
||||||
|
((EntityLinkor)y.EntityShip).AdditionalColor)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (((EntityLinkor)x.EntityShip).Rocket !=
|
||||||
|
((EntityLinkor)y.EntityShip).Rocket)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (((EntityLinkor)x.EntityShip).Gun !=
|
||||||
|
((EntityLinkor)y.EntityShip).Gun)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int GetHashCode([DisallowNull] DrawingShip? obj)
|
||||||
|
{
|
||||||
|
return obj.GetHashCode();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user