diff --git a/MotorShip/.vs/MotorShip/DesignTimeBuild/.dtbcache.v2 b/MotorShip/.vs/MotorShip/DesignTimeBuild/.dtbcache.v2 index d9b7247..0bec84c 100644 Binary files a/MotorShip/.vs/MotorShip/DesignTimeBuild/.dtbcache.v2 and b/MotorShip/.vs/MotorShip/DesignTimeBuild/.dtbcache.v2 differ diff --git a/MotorShip/.vs/MotorShip/FileContentIndex/1b1431b3-6ab1-41b2-a8db-6e681c6e678a.vsidx b/MotorShip/.vs/MotorShip/FileContentIndex/1b1431b3-6ab1-41b2-a8db-6e681c6e678a.vsidx deleted file mode 100644 index 6c19386..0000000 Binary files a/MotorShip/.vs/MotorShip/FileContentIndex/1b1431b3-6ab1-41b2-a8db-6e681c6e678a.vsidx and /dev/null differ diff --git a/MotorShip/.vs/MotorShip/FileContentIndex/1bf02bc5-d4d0-4eab-a92e-2acf2816d61c.vsidx b/MotorShip/.vs/MotorShip/FileContentIndex/1bf02bc5-d4d0-4eab-a92e-2acf2816d61c.vsidx new file mode 100644 index 0000000..12bab58 Binary files /dev/null and b/MotorShip/.vs/MotorShip/FileContentIndex/1bf02bc5-d4d0-4eab-a92e-2acf2816d61c.vsidx differ diff --git a/MotorShip/.vs/MotorShip/FileContentIndex/9779d555-e94b-4e77-9c96-3b6faa4834f0.vsidx b/MotorShip/.vs/MotorShip/FileContentIndex/9779d555-e94b-4e77-9c96-3b6faa4834f0.vsidx deleted file mode 100644 index 4c13bcd..0000000 Binary files a/MotorShip/.vs/MotorShip/FileContentIndex/9779d555-e94b-4e77-9c96-3b6faa4834f0.vsidx and /dev/null differ diff --git a/MotorShip/.vs/MotorShip/FileContentIndex/d34d53e3-4a93-47fa-a7c0-180334cd1924.vsidx b/MotorShip/.vs/MotorShip/FileContentIndex/d34d53e3-4a93-47fa-a7c0-180334cd1924.vsidx new file mode 100644 index 0000000..a1cf8f3 Binary files /dev/null and b/MotorShip/.vs/MotorShip/FileContentIndex/d34d53e3-4a93-47fa-a7c0-180334cd1924.vsidx differ diff --git a/MotorShip/.vs/MotorShip/FileContentIndex/df361c03-3539-4482-9dc5-759c4a48a1d1.vsidx b/MotorShip/.vs/MotorShip/FileContentIndex/df361c03-3539-4482-9dc5-759c4a48a1d1.vsidx new file mode 100644 index 0000000..5ca386d Binary files /dev/null and b/MotorShip/.vs/MotorShip/FileContentIndex/df361c03-3539-4482-9dc5-759c4a48a1d1.vsidx differ diff --git a/MotorShip/.vs/MotorShip/FileContentIndex/ea6c3961-def5-48a4-abce-5ef092b2c7de.vsidx b/MotorShip/.vs/MotorShip/FileContentIndex/ea6c3961-def5-48a4-abce-5ef092b2c7de.vsidx new file mode 100644 index 0000000..16d2e94 Binary files /dev/null and b/MotorShip/.vs/MotorShip/FileContentIndex/ea6c3961-def5-48a4-abce-5ef092b2c7de.vsidx differ diff --git a/MotorShip/.vs/MotorShip/FileContentIndex/f475d41f-518a-411e-a934-2c6bef37434f.vsidx b/MotorShip/.vs/MotorShip/FileContentIndex/f475d41f-518a-411e-a934-2c6bef37434f.vsidx deleted file mode 100644 index 0999b2c..0000000 Binary files a/MotorShip/.vs/MotorShip/FileContentIndex/f475d41f-518a-411e-a934-2c6bef37434f.vsidx and /dev/null differ diff --git a/MotorShip/.vs/MotorShip/FileContentIndex/f8e39df5-54dd-473b-b8d8-22bb6279242d.vsidx b/MotorShip/.vs/MotorShip/FileContentIndex/f8e39df5-54dd-473b-b8d8-22bb6279242d.vsidx deleted file mode 100644 index 8382a5d..0000000 Binary files a/MotorShip/.vs/MotorShip/FileContentIndex/f8e39df5-54dd-473b-b8d8-22bb6279242d.vsidx and /dev/null differ diff --git a/MotorShip/.vs/MotorShip/v17/.futdcache.v2 b/MotorShip/.vs/MotorShip/v17/.futdcache.v2 deleted file mode 100644 index 580bb5d..0000000 Binary files a/MotorShip/.vs/MotorShip/v17/.futdcache.v2 and /dev/null differ diff --git a/MotorShip/.vs/MotorShip/v17/.suo b/MotorShip/.vs/MotorShip/v17/.suo deleted file mode 100644 index ef0da06..0000000 Binary files a/MotorShip/.vs/MotorShip/v17/.suo and /dev/null differ diff --git a/MotorShip/.vs/ProjectEvaluation/motorship.metadata.v5.1 b/MotorShip/.vs/ProjectEvaluation/motorship.metadata.v5.1 index c3e0330..a870e25 100644 Binary files a/MotorShip/.vs/ProjectEvaluation/motorship.metadata.v5.1 and b/MotorShip/.vs/ProjectEvaluation/motorship.metadata.v5.1 differ diff --git a/MotorShip/.vs/ProjectEvaluation/motorship.projects.v5.1 b/MotorShip/.vs/ProjectEvaluation/motorship.projects.v5.1 index 3d75fc4..42f2dc0 100644 Binary files a/MotorShip/.vs/ProjectEvaluation/motorship.projects.v5.1 and b/MotorShip/.vs/ProjectEvaluation/motorship.projects.v5.1 differ diff --git a/MotorShip/.vs/WarmlyShip/v17/.suo b/MotorShip/.vs/WarmlyShip/v17/.suo new file mode 100644 index 0000000..6e74cc6 Binary files /dev/null and b/MotorShip/.vs/WarmlyShip/v17/.suo differ diff --git a/MotorShip/MotorShip/AbstractStrategy.cs b/MotorShip/MotorShip/AbstractStrategy.cs new file mode 100644 index 0000000..eab1b7a --- /dev/null +++ b/MotorShip/MotorShip/AbstractStrategy.cs @@ -0,0 +1,109 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WarmlyShip.DrawingObjects; + + +namespace WarmlyShip.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(); + } + /// + /// Перемещение влево + /// + /// Результат перемещения (true - удалось переместиться, false - неудача) + protected bool MoveLeft() => MoveTo(DirectionType.Left); + /// + /// Перемещение вправо + /// + /// Результат перемещения (true - удалось переместиться, false - неудача) + protected bool MoveRight() => MoveTo(DirectionType.Right); + /// + /// Перемещение вверх + /// + /// Результат перемещения (true - удалось переместиться, false - неудача) + protected bool MoveUp() => MoveTo(DirectionType.Up); + /// + /// Перемещение вниз + /// + /// Результат перемещения (true - удалось переместиться, false - неудача) + protected bool MoveDown() => MoveTo(DirectionType.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(); + /// + /// Попытка перемещения в требуемом направлении + /// + /// Направление + /// Результат попытки (true - удалось переместиться, false - неудача) + private bool MoveTo(DirectionType directionType) + { + if (_state != Status.InProgress) + { + return false; + } + if (_moveableObject?.CheckCanMove(directionType) ?? false) + { + _moveableObject.MoveObject(directionType); + return true; + } + return false; + } + } +} diff --git a/MotorShip/MotorShip/Direction.cs b/MotorShip/MotorShip/Direction.cs new file mode 100644 index 0000000..710d51a --- /dev/null +++ b/MotorShip/MotorShip/Direction.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WarmlyShip +{ + /// + /// Направление перемещения + /// + public enum DirectionType + { + /// + /// Вверх + /// + Up = 1, + /// + /// Вниз + /// + Down = 2, + /// + /// Влево + /// + Left = 3, + /// + /// Вправо + /// + Right = 4 + + } +} \ No newline at end of file diff --git a/MotorShip/MotorShip/DrawingObjectShip.cs b/MotorShip/MotorShip/DrawingObjectShip.cs new file mode 100644 index 0000000..e8716d2 --- /dev/null +++ b/MotorShip/MotorShip/DrawingObjectShip.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WarmlyShip.DrawingObjects; + +namespace WarmlyShip.MovementStrategy +{ + public class DrawingObjectShip : IMoveableObject + { + private readonly DrawingWarmlyShip? _drawingWarmlyShip = null; + public DrawingObjectShip(DrawingWarmlyShip drawingWarmlyShip) + { + _drawingWarmlyShip = drawingWarmlyShip; + } + public ObjectParameters? GetObjectPosition + { + get + { + if (_drawingWarmlyShip == null || _drawingWarmlyShip.EntityWarmlyShip == null) + { + return null; + } + return new ObjectParameters(_drawingWarmlyShip.GetPosX, + _drawingWarmlyShip.GetPosY, _drawingWarmlyShip.GetWidth, _drawingWarmlyShip.GetHeight); + } + } + public int GetStep => (int)(_drawingWarmlyShip?.EntityWarmlyShip?.Step ?? 0); + public bool CheckCanMove(DirectionType direction) => + _drawingWarmlyShip?.CanMove(direction) ?? false; + public void MoveObject(DirectionType direction) => + _drawingWarmlyShip?.MoveTransport(direction); + } +} diff --git a/MotorShip/MotorShip/DrawingWarmlyShip.cs b/MotorShip/MotorShip/DrawingWarmlyShip.cs new file mode 100644 index 0000000..871c338 --- /dev/null +++ b/MotorShip/MotorShip/DrawingWarmlyShip.cs @@ -0,0 +1,133 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WarmlyShip.Entities; +using WarmlyShip.MovementStrategy; + +namespace WarmlyShip.DrawingObjects +{ + public class DrawingWarmlyShip + { + public EntityWarmlyShip? EntityWarmlyShip { get; protected set; } + private int _pictureWidth; + private int _pictureHeight; + protected int _startPosX; + protected int _startPosY; + protected readonly int _WarmlyShipWidth = 185; + protected readonly int _WarmlyShipHeight = 180; + public DrawingWarmlyShip(int speed, double weight, Color bodyColor, int width, int height) + { + if (width < _WarmlyShipWidth || height < _WarmlyShipHeight) + { + return; + } + _pictureWidth = width; + _pictureHeight = height; + EntityWarmlyShip = new EntityWarmlyShip(speed, weight, bodyColor); + + } + protected DrawingWarmlyShip(int speed, double weight, Color bodyColor, int + width, int height, int warmlyShipWidth, int warmlyShipHeight) + { + if (width <= _WarmlyShipWidth || height <= _WarmlyShipHeight) + return; + _pictureWidth = width; + _pictureHeight = height; + _WarmlyShipWidth = warmlyShipWidth; + _WarmlyShipHeight = warmlyShipHeight; + EntityWarmlyShip = new EntityWarmlyShip(speed, weight, bodyColor); + } + public void SetPosition(int x, int y) + { + if (x >= 0 && x + _WarmlyShipWidth <= _pictureWidth && y >= 0 && y + _WarmlyShipHeight <= _pictureHeight) + { + _startPosX = x; + _startPosY = y; + } + } + public virtual void DrawTransport(Graphics g) + { + if (EntityWarmlyShip == null) + { + return; + } + Pen pen = new(Color.Black, 2); + Pen anchor = new(Color.Black, 4); + Brush bodyBrush = new SolidBrush(EntityWarmlyShip.BodyColor); + //корпус теплохода + Point[] hull = new Point[] + { + new Point(_startPosX, _startPosY + 110), + new Point(_startPosX + 180, _startPosY + 110), + new Point(_startPosX + 140, _startPosY + 185), + new Point(_startPosX + 40, _startPosY + 185), + }; + g.FillPolygon(bodyBrush, hull); + g.DrawPolygon(pen, hull); + //палуба + g.FillRectangle(bodyBrush, _startPosX + 25, _startPosY + 80, 130, 30); + g.DrawRectangle(pen, _startPosX + 25, _startPosY + 80, 130, 30); + + //якорь + g.DrawLine(anchor, new Point(_startPosX + 50, _startPosY + 130), new Point(_startPosX + 50, _startPosY + 150)); + g.DrawLine(anchor, new Point(_startPosX + 40, _startPosY + 140), new Point(_startPosX + 60, _startPosY + 140)); + g.DrawLine(anchor, new Point(_startPosX + 45, _startPosY + 150), new Point(_startPosX + 55, _startPosY + 150)); + } + public int GetPosX => _startPosX; + public int GetPosY => _startPosY; + public int GetWidth => _WarmlyShipWidth; + public int GetHeight => _WarmlyShipHeight; + public bool CanMove(DirectionType direction) + { + if (EntityWarmlyShip == null) + { + return false; + } + return direction switch + { + //влево + DirectionType.Left => _startPosX - EntityWarmlyShip.Step > 0, + //вверх + DirectionType.Up => _startPosY - EntityWarmlyShip.Step > 0, + //вправо + DirectionType.Right => _startPosX + EntityWarmlyShip.Step + _WarmlyShipWidth < _pictureWidth, + //вниз + DirectionType.Down => _startPosY + EntityWarmlyShip.Step + _WarmlyShipHeight < _pictureHeight, + _ => false, + }; + } + public void MoveTransport(DirectionType direction) + { + if (!CanMove(direction) || EntityWarmlyShip == null) + { + return; + } + switch (direction) + { + //влево + case DirectionType.Left: + _startPosX -= (int)EntityWarmlyShip.Step; + break; + //вверх + case DirectionType.Up: + _startPosY -= (int)EntityWarmlyShip.Step; + break; + // вправо + case DirectionType.Right: + _startPosX += (int)EntityWarmlyShip.Step; + break; + //вниз + case DirectionType.Down: + _startPosY += (int)EntityWarmlyShip.Step; + break; + } + } + /// + /// Получение объекта IMoveableObject из объекта DrawingCar + /// + public IMoveableObject GetMoveableObject => new DrawingObjectShip(this); + } +} + diff --git a/MotorShip/MotorShip/DrawingWarmlyShipWithPipes.cs b/MotorShip/MotorShip/DrawingWarmlyShipWithPipes.cs new file mode 100644 index 0000000..6e264c6 --- /dev/null +++ b/MotorShip/MotorShip/DrawingWarmlyShipWithPipes.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WarmlyShip.Entities; + +namespace WarmlyShip.DrawingObjects +{ + public class DrawingWarmlyShipWithPipes : DrawingWarmlyShip + { + public DrawingWarmlyShipWithPipes(int speed, double weight, Color bodyColor, Color + additionalColor, bool pipes, bool section, int width, int height) + : base(speed, weight, bodyColor, width, height, 185, 180) + { + if (EntityWarmlyShip != null) + { + EntityWarmlyShip = new EntityWarmlyShipWithPipes(speed, weight, bodyColor, additionalColor, pipes, section); + } + } + public override void DrawTransport(Graphics g) + { + if (EntityWarmlyShip is not EntityWarmlyShipWithPipes warmlyShip) + { + return; + } + Pen pen = new(Color.Black, 2); + Brush additionalBrush = new SolidBrush(warmlyShip.AdditionalColor); + base.DrawTransport(g); + //отсек для топлива + Brush brGray = new SolidBrush(Color.Gray); + if (warmlyShip.Section) + { + g.FillEllipse(brGray, _startPosX + 130, _startPosY + 130, 20, 20); + g.DrawEllipse(pen, _startPosX + 130, _startPosY + 130, 20, 20); + } + //трубы + if (warmlyShip.Pipes) + { + g.FillRectangle(additionalBrush, _startPosX + 55, _startPosY, 25, 80); + g.DrawRectangle(pen, _startPosX + 55, _startPosY, 25, 80); + g.FillRectangle(additionalBrush, _startPosX + 90, _startPosY + 20, 25, 60); + g.DrawRectangle(pen, _startPosX + 90, _startPosY + 20, 25, 60); + } + } + } +} diff --git a/MotorShip/MotorShip/EntityWarmlyShip.cs b/MotorShip/MotorShip/EntityWarmlyShip.cs new file mode 100644 index 0000000..c7152c3 --- /dev/null +++ b/MotorShip/MotorShip/EntityWarmlyShip.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WarmlyShip.Entities +{ + public class EntityWarmlyShip + { + 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 EntityWarmlyShip(int speed, double weight, Color bodyColor) + { + Speed = speed; + Weight = weight; + BodyColor = bodyColor; + } + } +} diff --git a/MotorShip/MotorShip/EntityWarmlyShipWithPipes.cs b/MotorShip/MotorShip/EntityWarmlyShipWithPipes.cs new file mode 100644 index 0000000..b7b82ce --- /dev/null +++ b/MotorShip/MotorShip/EntityWarmlyShipWithPipes.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WarmlyShip.Entities +{ + public class EntityWarmlyShipWithPipes : EntityWarmlyShip + { + public Color AdditionalColor { get; private set; } + public bool Pipes { get; private set; } + public bool Section { get; private set; } + public EntityWarmlyShipWithPipes(int speed, double weight, Color bodyColor, Color + additionalColor, bool pipes, bool section) + : base(speed, weight, bodyColor) + { + AdditionalColor = additionalColor; + Pipes = pipes; + Section = section; + } + } +} diff --git a/MotorShip/MotorShip/Form1.Designer.cs b/MotorShip/MotorShip/Form1.Designer.cs deleted file mode 100644 index 1995d57..0000000 --- a/MotorShip/MotorShip/Form1.Designer.cs +++ /dev/null @@ -1,39 +0,0 @@ -namespace MotorShip -{ - partial class Form1 - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - 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 - } -} \ No newline at end of file diff --git a/MotorShip/MotorShip/Form1.cs b/MotorShip/MotorShip/Form1.cs deleted file mode 100644 index d876784..0000000 --- a/MotorShip/MotorShip/Form1.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace MotorShip -{ - public partial class Form1 : Form - { - public Form1() - { - InitializeComponent(); - } - } -} \ No newline at end of file diff --git a/MotorShip/MotorShip/FormShipCollection.Designer.cs b/MotorShip/MotorShip/FormShipCollection.Designer.cs new file mode 100644 index 0000000..d9a2e99 --- /dev/null +++ b/MotorShip/MotorShip/FormShipCollection.Designer.cs @@ -0,0 +1,131 @@ +namespace WarmlyShip +{ + partial class FormShipCollection + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.pictureBoxCollection = new System.Windows.Forms.PictureBox(); + this.panelCollection = new System.Windows.Forms.Panel(); + this.labelCollection = new System.Windows.Forms.Label(); + this.buttonAddShip = new System.Windows.Forms.Button(); + this.maskedTextBoxNumber = new System.Windows.Forms.MaskedTextBox(); + this.buttonRemoveShip = new System.Windows.Forms.Button(); + this.buttonRefreshCollection = new System.Windows.Forms.Button(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBoxCollection)).BeginInit(); + this.panelCollection.SuspendLayout(); + this.SuspendLayout(); + // + // pictureBoxCollection + // + this.pictureBoxCollection.Location = new System.Drawing.Point(0, 0); + this.pictureBoxCollection.Name = "pictureBoxCollection"; + this.pictureBoxCollection.Size = new System.Drawing.Size(700, 453); + this.pictureBoxCollection.TabIndex = 0; + this.pictureBoxCollection.TabStop = false; + // + // panelCollection + // + this.panelCollection.Controls.Add(this.buttonRefreshCollection); + this.panelCollection.Controls.Add(this.buttonRemoveShip); + this.panelCollection.Controls.Add(this.maskedTextBoxNumber); + this.panelCollection.Controls.Add(this.buttonAddShip); + this.panelCollection.Controls.Add(this.labelCollection); + this.panelCollection.Location = new System.Drawing.Point(699, 0); + this.panelCollection.Name = "panelCollection"; + this.panelCollection.Size = new System.Drawing.Size(218, 453); + this.panelCollection.TabIndex = 1; + // + // labelCollection + // + this.labelCollection.AutoSize = true; + this.labelCollection.Location = new System.Drawing.Point(3, 9); + this.labelCollection.Name = "labelCollection"; + this.labelCollection.Size = new System.Drawing.Size(103, 20); + this.labelCollection.TabIndex = 0; + this.labelCollection.Text = "Инструменты"; + // + // buttonAddShip + // + this.buttonAddShip.Location = new System.Drawing.Point(16, 38); + this.buttonAddShip.Name = "buttonAddShip"; + this.buttonAddShip.Size = new System.Drawing.Size(171, 40); + this.buttonAddShip.TabIndex = 1; + this.buttonAddShip.Text = "Добавить теплоход"; + this.buttonAddShip.UseVisualStyleBackColor = true; + // + // maskedTextBoxNumber + // + this.maskedTextBoxNumber.Location = new System.Drawing.Point(16, 117); + this.maskedTextBoxNumber.Name = "maskedTextBoxNumber"; + this.maskedTextBoxNumber.Size = new System.Drawing.Size(171, 27); + this.maskedTextBoxNumber.TabIndex = 2; + // + // buttonRemoveShip + // + this.buttonRemoveShip.Location = new System.Drawing.Point(16, 166); + this.buttonRemoveShip.Name = "buttonRemoveShip"; + this.buttonRemoveShip.Size = new System.Drawing.Size(171, 40); + this.buttonRemoveShip.TabIndex = 3; + this.buttonRemoveShip.Text = "Удалить теплоход"; + this.buttonRemoveShip.UseVisualStyleBackColor = true; + // + // buttonRefreshCollection + // + this.buttonRefreshCollection.Location = new System.Drawing.Point(16, 239); + this.buttonRefreshCollection.Name = "buttonRefreshCollection"; + this.buttonRefreshCollection.Size = new System.Drawing.Size(171, 40); + this.buttonRefreshCollection.TabIndex = 4; + this.buttonRefreshCollection.Text = "Обновить коллекцию"; + this.buttonRefreshCollection.UseVisualStyleBackColor = true; + // + // FormShipCollection + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(918, 453); + this.Controls.Add(this.panelCollection); + this.Controls.Add(this.pictureBoxCollection); + this.Name = "FormShipCollection"; + this.Text = "FormShipCollection"; + ((System.ComponentModel.ISupportInitialize)(this.pictureBoxCollection)).EndInit(); + this.panelCollection.ResumeLayout(false); + this.panelCollection.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private PictureBox pictureBoxCollection; + private Panel panelCollection; + private Button buttonRefreshCollection; + private Button buttonRemoveShip; + private MaskedTextBox maskedTextBoxNumber; + private Button buttonAddShip; + private Label labelCollection; + } +} \ No newline at end of file diff --git a/MotorShip/MotorShip/FormShipCollection.cs b/MotorShip/MotorShip/FormShipCollection.cs new file mode 100644 index 0000000..b82aeb8 --- /dev/null +++ b/MotorShip/MotorShip/FormShipCollection.cs @@ -0,0 +1,20 @@ +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; + +namespace WarmlyShip +{ + public partial class FormShipCollection : Form + { + public FormShipCollection() + { + InitializeComponent(); + } + } +} diff --git a/MotorShip/MotorShip/FormShipCollection.resx b/MotorShip/MotorShip/FormShipCollection.resx new file mode 100644 index 0000000..f298a7b --- /dev/null +++ b/MotorShip/MotorShip/FormShipCollection.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/MotorShip/MotorShip/FormWarmlyShip.Designer.cs b/MotorShip/MotorShip/FormWarmlyShip.Designer.cs new file mode 100644 index 0000000..34bb550 --- /dev/null +++ b/MotorShip/MotorShip/FormWarmlyShip.Designer.cs @@ -0,0 +1,179 @@ +namespace MotorShip +{ + partial class FormWarmlyShip + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.pictureBoxWarmlyShip = new System.Windows.Forms.PictureBox(); + this.buttonCreateWarmlyShip = new System.Windows.Forms.Button(); + this.buttonCreate = new System.Windows.Forms.Button(); + this.buttonStep = new System.Windows.Forms.Button(); + this.comboBoxStrategy = new System.Windows.Forms.ComboBox(); + this.buttonSelectShip = new System.Windows.Forms.Button(); + this.buttonLeft = new System.Windows.Forms.Button(); + this.buttonUp = new System.Windows.Forms.Button(); + this.buttonDown = new System.Windows.Forms.Button(); + this.buttonRight = new System.Windows.Forms.Button(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBoxWarmlyShip)).BeginInit(); + this.SuspendLayout(); + // + // pictureBoxWarmlyShip + // + this.pictureBoxWarmlyShip.Dock = System.Windows.Forms.DockStyle.Fill; + this.pictureBoxWarmlyShip.Location = new System.Drawing.Point(0, 0); + this.pictureBoxWarmlyShip.Name = "pictureBoxWarmlyShip"; + this.pictureBoxWarmlyShip.Size = new System.Drawing.Size(882, 453); + this.pictureBoxWarmlyShip.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.pictureBoxWarmlyShip.TabIndex = 0; + this.pictureBoxWarmlyShip.TabStop = false; + this.pictureBoxWarmlyShip.Click += new System.EventHandler(this.pictureBoxWarmlyShip_Click); + // + // buttonCreateWarmlyShip + // + this.buttonCreateWarmlyShip.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonCreateWarmlyShip.Location = new System.Drawing.Point(12, 389); + this.buttonCreateWarmlyShip.Name = "buttonCreateWarmlyShip"; + this.buttonCreateWarmlyShip.Size = new System.Drawing.Size(163, 50); + this.buttonCreateWarmlyShip.TabIndex = 1; + this.buttonCreateWarmlyShip.Text = "Создать теплоход с трубами"; + this.buttonCreateWarmlyShip.UseVisualStyleBackColor = true; + // + // buttonCreate + // + this.buttonCreate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonCreate.Location = new System.Drawing.Point(197, 389); + this.buttonCreate.Name = "buttonCreate"; + this.buttonCreate.Size = new System.Drawing.Size(122, 50); + this.buttonCreate.TabIndex = 2; + this.buttonCreate.Text = "Создать теплоход"; + this.buttonCreate.UseVisualStyleBackColor = true; + // + // buttonStep + // + this.buttonStep.Location = new System.Drawing.Point(720, 56); + this.buttonStep.Name = "buttonStep"; + this.buttonStep.Size = new System.Drawing.Size(150, 29); + this.buttonStep.TabIndex = 8; + this.buttonStep.Text = "Шаг"; + this.buttonStep.UseVisualStyleBackColor = true; + // + // comboBoxStrategy + // + this.comboBoxStrategy.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxStrategy.FormattingEnabled = true; + this.comboBoxStrategy.Location = new System.Drawing.Point(720, 13); + this.comboBoxStrategy.Name = "comboBoxStrategy"; + this.comboBoxStrategy.Size = new System.Drawing.Size(151, 28); + this.comboBoxStrategy.TabIndex = 7; + // + // buttonSelectShip + // + this.buttonSelectShip.Location = new System.Drawing.Point(720, 107); + this.buttonSelectShip.Name = "buttonSelectShip"; + this.buttonSelectShip.Size = new System.Drawing.Size(150, 29); + this.buttonSelectShip.TabIndex = 9; + this.buttonSelectShip.Text = "Выбрать теплоход"; + this.buttonSelectShip.UseVisualStyleBackColor = true; + // + // buttonLeft + // + this.buttonLeft.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonLeft.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.buttonLeft.Location = new System.Drawing.Point(720, 411); + this.buttonLeft.Name = "buttonLeft"; + this.buttonLeft.Size = new System.Drawing.Size(30, 30); + this.buttonLeft.TabIndex = 3; + this.buttonLeft.UseVisualStyleBackColor = true; + // + // buttonUp + // + this.buttonUp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonUp.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.buttonUp.Location = new System.Drawing.Point(756, 375); + this.buttonUp.Name = "buttonUp"; + this.buttonUp.Size = new System.Drawing.Size(30, 30); + this.buttonUp.TabIndex = 4; + this.buttonUp.UseVisualStyleBackColor = true; + // + // buttonDown + // + this.buttonDown.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonDown.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.buttonDown.Location = new System.Drawing.Point(756, 411); + this.buttonDown.Name = "buttonDown"; + this.buttonDown.Size = new System.Drawing.Size(30, 30); + this.buttonDown.TabIndex = 5; + this.buttonDown.UseVisualStyleBackColor = true; + // + // buttonRight + // + this.buttonRight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonRight.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.buttonRight.Location = new System.Drawing.Point(792, 411); + this.buttonRight.Name = "buttonRight"; + this.buttonRight.Size = new System.Drawing.Size(30, 30); + this.buttonRight.TabIndex = 6; + this.buttonRight.UseVisualStyleBackColor = true; + // + // FormWarmlyShip + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.ClientSize = new System.Drawing.Size(882, 453); + this.Controls.Add(this.buttonRight); + this.Controls.Add(this.buttonDown); + this.Controls.Add(this.buttonUp); + this.Controls.Add(this.buttonLeft); + this.Controls.Add(this.buttonSelectShip); + this.Controls.Add(this.comboBoxStrategy); + this.Controls.Add(this.buttonStep); + this.Controls.Add(this.buttonCreate); + this.Controls.Add(this.buttonCreateWarmlyShip); + this.Controls.Add(this.pictureBoxWarmlyShip); + this.Name = "FormWarmlyShip"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "Теплоход"; + this.Load += new System.EventHandler(this.FormWarmlyShip_Load); + ((System.ComponentModel.ISupportInitialize)(this.pictureBoxWarmlyShip)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private PictureBox pictureBoxWarmlyShip; + private Button buttonCreateWarmlyShip; + private Button buttonCreate; + private Button buttonStep; + private ComboBox comboBoxStrategy; + private Button buttonSelectShip; + private Button buttonLeft; + private Button buttonUp; + private Button buttonDown; + private Button buttonRight; + } +} \ No newline at end of file diff --git a/MotorShip/MotorShip/FormWarmlyShip.cs b/MotorShip/MotorShip/FormWarmlyShip.cs new file mode 100644 index 0000000..fc4bafa --- /dev/null +++ b/MotorShip/MotorShip/FormWarmlyShip.cs @@ -0,0 +1,20 @@ +namespace MotorShip +{ + public partial class FormWarmlyShip : Form + { + public FormWarmlyShip() + { + InitializeComponent(); + } + + private void FormWarmlyShip_Load(object sender, EventArgs e) + { + + } + + private void pictureBoxWarmlyShip_Click(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file diff --git a/MotorShip/MotorShip/FormWarmlyShip.resx b/MotorShip/MotorShip/FormWarmlyShip.resx new file mode 100644 index 0000000..f298a7b --- /dev/null +++ b/MotorShip/MotorShip/FormWarmlyShip.resx @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/MotorShip/MotorShip/IMoveableObject.cs b/MotorShip/MotorShip/IMoveableObject.cs new file mode 100644 index 0000000..b9673f3 --- /dev/null +++ b/MotorShip/MotorShip/IMoveableObject.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WarmlyShip.DrawingObjects; + + +namespace WarmlyShip.MovementStrategy +{ + public interface IMoveableObject + { + ObjectParameters? GetObjectPosition { get; } + int GetStep { get; } + bool CheckCanMove(DirectionType direction); + void MoveObject(DirectionType direction); + } +} diff --git a/MotorShip/MotorShip/MotorShip.csproj b/MotorShip/MotorShip/MotorShip.csproj deleted file mode 100644 index b57c89e..0000000 --- a/MotorShip/MotorShip/MotorShip.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - WinExe - net6.0-windows - enable - true - enable - - - \ No newline at end of file diff --git a/MotorShip/MotorShip/MotorShip.csproj.user b/MotorShip/MotorShip/MotorShip.csproj.user deleted file mode 100644 index 7814ea2..0000000 --- a/MotorShip/MotorShip/MotorShip.csproj.user +++ /dev/null @@ -1,8 +0,0 @@ - - - - - Form - - - diff --git a/MotorShip/MotorShip/MoveToBorder.cs b/MotorShip/MotorShip/MoveToBorder.cs new file mode 100644 index 0000000..c005a16 --- /dev/null +++ b/MotorShip/MotorShip/MoveToBorder.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WarmlyShip.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(); + } + } + } + } +} diff --git a/MotorShip/MotorShip/MoveToCenter.cs b/MotorShip/MotorShip/MoveToCenter.cs new file mode 100644 index 0000000..bd3a8f8 --- /dev/null +++ b/MotorShip/MotorShip/MoveToCenter.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WarmlyShip.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(); + } + } + } + } +} \ No newline at end of file diff --git a/MotorShip/MotorShip/ObjectParameters.cs b/MotorShip/MotorShip/ObjectParameters.cs new file mode 100644 index 0000000..012d507 --- /dev/null +++ b/MotorShip/MotorShip/ObjectParameters.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WarmlyShip.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; + } + } +} diff --git a/MotorShip/MotorShip/Program.cs b/MotorShip/MotorShip/Program.cs index 07307e2..2dda87b 100644 --- a/MotorShip/MotorShip/Program.cs +++ b/MotorShip/MotorShip/Program.cs @@ -1,4 +1,4 @@ -namespace MotorShip +namespace WarmlyShip { internal static class Program { @@ -11,7 +11,7 @@ namespace MotorShip // 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 FormShipCollection()); } } } \ No newline at end of file diff --git a/MotorShip/MotorShip/Properties/Resources.Designer.cs b/MotorShip/MotorShip/Properties/Resources.Designer.cs new file mode 100644 index 0000000..4575920 --- /dev/null +++ b/MotorShip/MotorShip/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// Этот код создан программой. +// Исполняемая версия:4.0.30319.42000 +// +// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае +// повторной генерации кода. +// +//------------------------------------------------------------------------------ + +namespace WarmlyShip.Properties { + using System; + + + /// + /// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д. + /// + // Этот класс создан автоматически классом 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() { + } + + /// + /// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом. + /// + [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("WarmlyShip.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Перезаписывает свойство CurrentUICulture текущего потока для всех + /// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/MotorShip/MotorShip/Form1.resx b/MotorShip/MotorShip/Properties/Resources.resx similarity index 100% rename from MotorShip/MotorShip/Form1.resx rename to MotorShip/MotorShip/Properties/Resources.resx diff --git a/MotorShip/MotorShip/SetGeneric.cs b/MotorShip/MotorShip/SetGeneric.cs new file mode 100644 index 0000000..57d8652 --- /dev/null +++ b/MotorShip/MotorShip/SetGeneric.cs @@ -0,0 +1,97 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WarmlyShip.Generics +{ + internal class SetGeneric + where T : class + { + /// + /// Массив объектов, которые храним + /// + private readonly T?[] _places; + /// + /// Количество объектов в массиве + /// + public int Count => _places.Length; + /// + /// Конструктор + /// + /// + public SetGeneric(int count) + { + _places = new T?[count]; + } + /// + /// Добавление объекта в набор + /// + /// Добавляемый теплоход + /// + public int Insert(T warmlyship) + { + return Insert(warmlyship, 0); + } + /// + /// Добавление объекта в набор на конкретную позицию + /// + /// Добавляемый теплоход + /// Позиция + /// + public int Insert(T warmlyship, int position) + { + int nullIndex = -1; + int i; + + if (position < 0 || position >= Count) + return -1; + + for (i = position; i < Count; i++) + { + if (_places[i] == null) + { + nullIndex = i; + break; + } + } + if (nullIndex < 0) + return -1; + + for (i = nullIndex; i > position; i--) + { + _places[i] = _places[i - 1]; + } + _places[position] = warmlyship; + return position; + } + /// + /// Удаление объекта из набора с конкретной позиции + /// + /// + /// + 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 >= Count) + { + return null; + } + return _places[position]; + } + } +} \ No newline at end of file diff --git a/MotorShip/MotorShip/ShipsGenericCollection.cs b/MotorShip/MotorShip/ShipsGenericCollection.cs new file mode 100644 index 0000000..836d3ec --- /dev/null +++ b/MotorShip/MotorShip/ShipsGenericCollection.cs @@ -0,0 +1,150 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using WarmlyShip.DrawingObjects; +using WarmlyShip.MovementStrategy; +using static System.Windows.Forms.VisualStyles.VisualStyleElement; + +namespace WarmlyShip.Generics +{ + internal class ShipsGenericCollection + where T : DrawingWarmlyShip + where U : IMoveableObject + { + /// + /// Ширина окна прорисовки + /// + private readonly int _pictureWidth; + /// + /// Высота окна прорисовки + /// + private readonly int _pictureHeight; + /// + /// Размер занимаемого объектом места (ширина) + /// + private readonly int _placeSizeWidth = 185; + /// + /// Размер занимаемого объектом места (высота) + /// + private readonly int _placeSizeHeight = 185; + /// + /// Набор объектов + /// + private readonly SetGeneric _collection; + /// + /// Конструктор + /// + /// + /// + public ShipsGenericCollection(int picWidth, int picHeight) + { + int width = picWidth / _placeSizeWidth; + int height = picHeight / _placeSizeHeight; + _pictureWidth = picWidth; + _pictureHeight = picHeight; + _collection = new SetGeneric(width * height); + } + /// + /// Перегрузка оператора сложения + /// + /// + /// + /// + public static int operator +(ShipsGenericCollection collect, T? + obj) + { + if (obj == null) + { + return -1; + } + return collect._collection.Insert(obj); + } + /// + /// Перегрузка оператора вычитания + /// + /// + /// + /// + public static bool operator -(ShipsGenericCollection collect, int + pos) + { + T? obj = collect._collection.Get(pos); + if (obj != null) + { + collect._collection.Remove(pos); + } + return false; + } + /// + /// Получение объекта IMoveableObject + /// + /// + /// + public U? GetU(int pos) + { + return (U?)_collection.Get(pos)?.GetMoveableObject; + } + /// + /// Вывод всего набора объектов + /// + /// + public Bitmap ShowShips() + { + 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) + { + T? ship; + int width = _pictureWidth / _placeSizeWidth; + int diff = 1; + int currWidth = 0; + for (int i = 0; i < _collection.Count; i++) + { + currWidth++; + if (currWidth > width) + { + diff++; + currWidth = 1; + } + ship = _collection.Get(i); + if (ship != null) + { + ship.SetPosition((width - 1 - (i % width)) * _placeSizeWidth, i / width * _placeSizeHeight); + ship.DrawTransport(g); + } + } + } + } +} + diff --git a/MotorShip/MotorShip/Status.cs b/MotorShip/MotorShip/Status.cs new file mode 100644 index 0000000..2fa54d6 --- /dev/null +++ b/MotorShip/MotorShip/Status.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WarmlyShip.MovementStrategy +{ + public enum Status + { + NotInit, + InProgress, + Finish + } +} diff --git a/MotorShip/MotorShip/WarmlyShip.csproj b/MotorShip/MotorShip/WarmlyShip.csproj new file mode 100644 index 0000000..13ee123 --- /dev/null +++ b/MotorShip/MotorShip/WarmlyShip.csproj @@ -0,0 +1,26 @@ + + + + WinExe + net6.0-windows + enable + true + enable + + + + + True + True + Resources.resx + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + \ No newline at end of file diff --git a/MotorShip/MotorShip/WarmlyShip.csproj.user b/MotorShip/MotorShip/WarmlyShip.csproj.user new file mode 100644 index 0000000..2c3f5ef --- /dev/null +++ b/MotorShip/MotorShip/WarmlyShip.csproj.user @@ -0,0 +1,11 @@ + + + + + Form + + + Form + + + \ No newline at end of file diff --git a/MotorShip/MotorShip/bin/Debug/net6.0-windows/WarmlyShip.deps.json b/MotorShip/MotorShip/bin/Debug/net6.0-windows/WarmlyShip.deps.json new file mode 100644 index 0000000..ab5ee4e --- /dev/null +++ b/MotorShip/MotorShip/bin/Debug/net6.0-windows/WarmlyShip.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v6.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v6.0": { + "WarmlyShip/1.0.0": { + "runtime": { + "WarmlyShip.dll": {} + } + } + } + }, + "libraries": { + "WarmlyShip/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/MotorShip/MotorShip/bin/Debug/net6.0-windows/WarmlyShip.dll b/MotorShip/MotorShip/bin/Debug/net6.0-windows/WarmlyShip.dll new file mode 100644 index 0000000..630ce94 Binary files /dev/null and b/MotorShip/MotorShip/bin/Debug/net6.0-windows/WarmlyShip.dll differ diff --git a/MotorShip/MotorShip/bin/Debug/net6.0-windows/WarmlyShip.exe b/MotorShip/MotorShip/bin/Debug/net6.0-windows/WarmlyShip.exe new file mode 100644 index 0000000..b2c77b7 Binary files /dev/null and b/MotorShip/MotorShip/bin/Debug/net6.0-windows/WarmlyShip.exe differ diff --git a/MotorShip/MotorShip/bin/Debug/net6.0-windows/WarmlyShip.pdb b/MotorShip/MotorShip/bin/Debug/net6.0-windows/WarmlyShip.pdb new file mode 100644 index 0000000..14c1416 Binary files /dev/null and b/MotorShip/MotorShip/bin/Debug/net6.0-windows/WarmlyShip.pdb differ diff --git a/MotorShip/MotorShip/bin/Debug/net6.0-windows/WarmlyShip.runtimeconfig.json b/MotorShip/MotorShip/bin/Debug/net6.0-windows/WarmlyShip.runtimeconfig.json new file mode 100644 index 0000000..f9988b2 --- /dev/null +++ b/MotorShip/MotorShip/bin/Debug/net6.0-windows/WarmlyShip.runtimeconfig.json @@ -0,0 +1,15 @@ +{ + "runtimeOptions": { + "tfm": "net6.0", + "frameworks": [ + { + "name": "Microsoft.NETCore.App", + "version": "6.0.0" + }, + { + "name": "Microsoft.WindowsDesktop.App", + "version": "6.0.0" + } + ] + } +} \ No newline at end of file diff --git a/MotorShip/MotorShip/obj/Debug/net6.0-windows/MotorShip.FormWarmlyShip.resources b/MotorShip/MotorShip/obj/Debug/net6.0-windows/MotorShip.FormWarmlyShip.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/MotorShip/MotorShip/obj/Debug/net6.0-windows/MotorShip.FormWarmlyShip.resources differ diff --git a/MotorShip/MotorShip/obj/Debug/net6.0-windows/TempPE/Properties.Resources.Designer.cs.dll b/MotorShip/MotorShip/obj/Debug/net6.0-windows/TempPE/Properties.Resources.Designer.cs.dll new file mode 100644 index 0000000..0c97b20 Binary files /dev/null and b/MotorShip/MotorShip/obj/Debug/net6.0-windows/TempPE/Properties.Resources.Designer.cs.dll differ diff --git a/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.AssemblyInfo.cs b/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.AssemblyInfo.cs new file mode 100644 index 0000000..b9f3c84 --- /dev/null +++ b/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.AssemblyInfo.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------------------------ +// +// Этот код создан программой. +// Исполняемая версия:4.0.30319.42000 +// +// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае +// повторной генерации кода. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("WarmlyShip")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] +[assembly: System.Reflection.AssemblyProductAttribute("WarmlyShip")] +[assembly: System.Reflection.AssemblyTitleAttribute("WarmlyShip")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] +[assembly: System.Runtime.Versioning.TargetPlatformAttribute("Windows7.0")] +[assembly: System.Runtime.Versioning.SupportedOSPlatformAttribute("Windows7.0")] + +// Создано классом WriteCodeFragment MSBuild. + diff --git a/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.AssemblyInfoInputs.cache b/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.AssemblyInfoInputs.cache new file mode 100644 index 0000000..06c449e --- /dev/null +++ b/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +9e4fa9fd1ecdd07181264594cdb4ea30b2f8e7a9 diff --git a/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.FormShipCollection.resources b/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.FormShipCollection.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.FormShipCollection.resources differ diff --git a/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.GeneratedMSBuildEditorConfig.editorconfig b/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..b3295d3 --- /dev/null +++ b/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,16 @@ +is_global = true +build_property.ApplicationManifest = +build_property.StartupObject = +build_property.ApplicationDefaultFont = +build_property.ApplicationHighDpiMode = +build_property.ApplicationUseCompatibleTextRendering = +build_property.ApplicationVisualStyles = +build_property.TargetFramework = net6.0-windows +build_property.TargetPlatformMinVersion = 7.0 +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = WarmlyShip +build_property.ProjectDir = C:\Users\Екатерина\OneDrive\Desktop\РПП\MotorShip\MotorShip\ diff --git a/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.GlobalUsings.g.cs b/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.GlobalUsings.g.cs new file mode 100644 index 0000000..84bbb89 --- /dev/null +++ b/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.GlobalUsings.g.cs @@ -0,0 +1,10 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.Drawing; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; +global using global::System.Windows.Forms; diff --git a/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.Properties.Resources.resources b/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.Properties.Resources.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.Properties.Resources.resources differ diff --git a/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.assets.cache b/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.assets.cache new file mode 100644 index 0000000..44b7f68 Binary files /dev/null and b/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.assets.cache differ diff --git a/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.csproj.AssemblyReference.cache b/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.csproj.AssemblyReference.cache new file mode 100644 index 0000000..e23a5d6 Binary files /dev/null and b/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.csproj.AssemblyReference.cache differ diff --git a/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.csproj.BuildWithSkipAnalyzers b/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.csproj.BuildWithSkipAnalyzers new file mode 100644 index 0000000..e69de29 diff --git a/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.csproj.CoreCompileInputs.cache b/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..dafdd05 --- /dev/null +++ b/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +06cd6889c77069e0f55068eddb8f6c6d07ea4abf diff --git a/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.csproj.FileListAbsolute.txt b/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..41940be --- /dev/null +++ b/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.csproj.FileListAbsolute.txt @@ -0,0 +1,19 @@ +C:\Users\Екатерина\OneDrive\Desktop\РПП\MotorShip\MotorShip\bin\Debug\net6.0-windows\WarmlyShip.exe +C:\Users\Екатерина\OneDrive\Desktop\РПП\MotorShip\MotorShip\bin\Debug\net6.0-windows\WarmlyShip.deps.json +C:\Users\Екатерина\OneDrive\Desktop\РПП\MotorShip\MotorShip\bin\Debug\net6.0-windows\WarmlyShip.runtimeconfig.json +C:\Users\Екатерина\OneDrive\Desktop\РПП\MotorShip\MotorShip\bin\Debug\net6.0-windows\WarmlyShip.dll +C:\Users\Екатерина\OneDrive\Desktop\РПП\MotorShip\MotorShip\bin\Debug\net6.0-windows\WarmlyShip.pdb +C:\Users\Екатерина\OneDrive\Desktop\РПП\MotorShip\MotorShip\obj\Debug\net6.0-windows\WarmlyShip.csproj.AssemblyReference.cache +C:\Users\Екатерина\OneDrive\Desktop\РПП\MotorShip\MotorShip\obj\Debug\net6.0-windows\WarmlyShip.FormShipCollection.resources +C:\Users\Екатерина\OneDrive\Desktop\РПП\MotorShip\MotorShip\obj\Debug\net6.0-windows\MotorShip.FormWarmlyShip.resources +C:\Users\Екатерина\OneDrive\Desktop\РПП\MotorShip\MotorShip\obj\Debug\net6.0-windows\WarmlyShip.Properties.Resources.resources +C:\Users\Екатерина\OneDrive\Desktop\РПП\MotorShip\MotorShip\obj\Debug\net6.0-windows\WarmlyShip.csproj.GenerateResource.cache +C:\Users\Екатерина\OneDrive\Desktop\РПП\MotorShip\MotorShip\obj\Debug\net6.0-windows\WarmlyShip.GeneratedMSBuildEditorConfig.editorconfig +C:\Users\Екатерина\OneDrive\Desktop\РПП\MotorShip\MotorShip\obj\Debug\net6.0-windows\WarmlyShip.AssemblyInfoInputs.cache +C:\Users\Екатерина\OneDrive\Desktop\РПП\MotorShip\MotorShip\obj\Debug\net6.0-windows\WarmlyShip.AssemblyInfo.cs +C:\Users\Екатерина\OneDrive\Desktop\РПП\MotorShip\MotorShip\obj\Debug\net6.0-windows\WarmlyShip.csproj.CoreCompileInputs.cache +C:\Users\Екатерина\OneDrive\Desktop\РПП\MotorShip\MotorShip\obj\Debug\net6.0-windows\WarmlyShip.dll +C:\Users\Екатерина\OneDrive\Desktop\РПП\MotorShip\MotorShip\obj\Debug\net6.0-windows\refint\WarmlyShip.dll +C:\Users\Екатерина\OneDrive\Desktop\РПП\MotorShip\MotorShip\obj\Debug\net6.0-windows\WarmlyShip.pdb +C:\Users\Екатерина\OneDrive\Desktop\РПП\MotorShip\MotorShip\obj\Debug\net6.0-windows\WarmlyShip.genruntimeconfig.cache +C:\Users\Екатерина\OneDrive\Desktop\РПП\MotorShip\MotorShip\obj\Debug\net6.0-windows\ref\WarmlyShip.dll diff --git a/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.csproj.GenerateResource.cache b/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.csproj.GenerateResource.cache new file mode 100644 index 0000000..992a539 Binary files /dev/null and b/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.csproj.GenerateResource.cache differ diff --git a/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.designer.deps.json b/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.designer.deps.json new file mode 100644 index 0000000..706cdfa --- /dev/null +++ b/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.designer.deps.json @@ -0,0 +1,11 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v6.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v6.0": {} + }, + "libraries": {} +} \ No newline at end of file diff --git a/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.designer.runtimeconfig.json b/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.designer.runtimeconfig.json new file mode 100644 index 0000000..330b7e8 --- /dev/null +++ b/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.designer.runtimeconfig.json @@ -0,0 +1,23 @@ +{ + "runtimeOptions": { + "tfm": "net6.0", + "frameworks": [ + { + "name": "Microsoft.NETCore.App", + "version": "6.0.0" + }, + { + "name": "Microsoft.WindowsDesktop.App", + "version": "6.0.0" + } + ], + "additionalProbingPaths": [ + "C:\\Users\\Екатерина\\.dotnet\\store\\|arch|\\|tfm|", + "C:\\Users\\Екатерина\\.nuget\\packages", + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" + ], + "configProperties": { + "Microsoft.NETCore.DotNetHostPolicy.SetAppPaths": true + } + } +} \ No newline at end of file diff --git a/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.dll b/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.dll new file mode 100644 index 0000000..630ce94 Binary files /dev/null and b/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.dll differ diff --git a/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.genruntimeconfig.cache b/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.genruntimeconfig.cache new file mode 100644 index 0000000..e8067ac --- /dev/null +++ b/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.genruntimeconfig.cache @@ -0,0 +1 @@ +b5ff27391765f54d26fb3871c8501fdc7aeba875 diff --git a/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.pdb b/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.pdb new file mode 100644 index 0000000..14c1416 Binary files /dev/null and b/MotorShip/MotorShip/obj/Debug/net6.0-windows/WarmlyShip.pdb differ diff --git a/MotorShip/MotorShip/obj/Debug/net6.0-windows/_IsIncrementalBuild b/MotorShip/MotorShip/obj/Debug/net6.0-windows/_IsIncrementalBuild new file mode 100644 index 0000000..7276f87 --- /dev/null +++ b/MotorShip/MotorShip/obj/Debug/net6.0-windows/_IsIncrementalBuild @@ -0,0 +1 @@ +obj\Debug\net6.0-windows\\_IsIncrementalBuild diff --git a/MotorShip/MotorShip/obj/Debug/net6.0-windows/apphost.exe b/MotorShip/MotorShip/obj/Debug/net6.0-windows/apphost.exe new file mode 100644 index 0000000..b2c77b7 Binary files /dev/null and b/MotorShip/MotorShip/obj/Debug/net6.0-windows/apphost.exe differ diff --git a/MotorShip/MotorShip/obj/Debug/net6.0-windows/ref/WarmlyShip.dll b/MotorShip/MotorShip/obj/Debug/net6.0-windows/ref/WarmlyShip.dll new file mode 100644 index 0000000..07f972e Binary files /dev/null and b/MotorShip/MotorShip/obj/Debug/net6.0-windows/ref/WarmlyShip.dll differ diff --git a/MotorShip/MotorShip/obj/Debug/net6.0-windows/refint/WarmlyShip.dll b/MotorShip/MotorShip/obj/Debug/net6.0-windows/refint/WarmlyShip.dll new file mode 100644 index 0000000..07f972e Binary files /dev/null and b/MotorShip/MotorShip/obj/Debug/net6.0-windows/refint/WarmlyShip.dll differ diff --git a/MotorShip/MotorShip/obj/WarmlyShip.csproj.nuget.dgspec.json b/MotorShip/MotorShip/obj/WarmlyShip.csproj.nuget.dgspec.json new file mode 100644 index 0000000..42c07eb --- /dev/null +++ b/MotorShip/MotorShip/obj/WarmlyShip.csproj.nuget.dgspec.json @@ -0,0 +1,71 @@ +{ + "format": 1, + "restore": { + "C:\\Users\\Екатерина\\OneDrive\\Desktop\\РПП\\MotorShip\\MotorShip\\WarmlyShip.csproj": {} + }, + "projects": { + "C:\\Users\\Екатерина\\OneDrive\\Desktop\\РПП\\MotorShip\\MotorShip\\WarmlyShip.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "C:\\Users\\Екатерина\\OneDrive\\Desktop\\РПП\\MotorShip\\MotorShip\\WarmlyShip.csproj", + "projectName": "WarmlyShip", + "projectPath": "C:\\Users\\Екатерина\\OneDrive\\Desktop\\РПП\\MotorShip\\MotorShip\\WarmlyShip.csproj", + "packagesPath": "C:\\Users\\Екатерина\\.nuget\\packages\\", + "outputPath": "C:\\Users\\Екатерина\\OneDrive\\Desktop\\РПП\\MotorShip\\MotorShip\\obj\\", + "projectStyle": "PackageReference", + "fallbackFolders": [ + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" + ], + "configFilePaths": [ + "C:\\Users\\Екатерина\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "net6.0-windows" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "C:\\Program Files\\dotnet\\library-packs": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net6.0-windows7.0": { + "targetAlias": "net6.0-windows", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "net6.0-windows7.0": { + "targetAlias": "net6.0-windows", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + }, + "Microsoft.WindowsDesktop.App.WindowsForms": { + "privateAssets": "none" + } + }, + "runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.401\\RuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/MotorShip/MotorShip/obj/WarmlyShip.csproj.nuget.g.props b/MotorShip/MotorShip/obj/WarmlyShip.csproj.nuget.g.props new file mode 100644 index 0000000..005c34f --- /dev/null +++ b/MotorShip/MotorShip/obj/WarmlyShip.csproj.nuget.g.props @@ -0,0 +1,16 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + $(UserProfile)\.nuget\packages\ + C:\Users\Екатерина\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages + PackageReference + 6.3.0 + + + + + + \ No newline at end of file diff --git a/MotorShip/MotorShip/obj/WarmlyShip.csproj.nuget.g.targets b/MotorShip/MotorShip/obj/WarmlyShip.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/MotorShip/MotorShip/obj/WarmlyShip.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/MotorShip/MotorShip/obj/project.assets.json b/MotorShip/MotorShip/obj/project.assets.json index 333198e..1c83751 100644 --- a/MotorShip/MotorShip/obj/project.assets.json +++ b/MotorShip/MotorShip/obj/project.assets.json @@ -14,9 +14,9 @@ "project": { "version": "1.0.0", "restore": { - "projectUniqueName": "C:\\Users\\Екатерина\\OneDrive\\Desktop\\РПП\\MotorShip\\MotorShip\\MotorShip.csproj", - "projectName": "MotorShip", - "projectPath": "C:\\Users\\Екатерина\\OneDrive\\Desktop\\РПП\\MotorShip\\MotorShip\\MotorShip.csproj", + "projectUniqueName": "C:\\Users\\Екатерина\\OneDrive\\Desktop\\РПП\\MotorShip\\MotorShip\\WarmlyShip.csproj", + "projectName": "WarmlyShip", + "projectPath": "C:\\Users\\Екатерина\\OneDrive\\Desktop\\РПП\\MotorShip\\MotorShip\\WarmlyShip.csproj", "packagesPath": "C:\\Users\\Екатерина\\.nuget\\packages\\", "outputPath": "C:\\Users\\Екатерина\\OneDrive\\Desktop\\РПП\\MotorShip\\MotorShip\\obj\\", "projectStyle": "PackageReference", diff --git a/MotorShip/MotorShip/obj/project.nuget.cache b/MotorShip/MotorShip/obj/project.nuget.cache index 21a391b..7d46eee 100644 --- a/MotorShip/MotorShip/obj/project.nuget.cache +++ b/MotorShip/MotorShip/obj/project.nuget.cache @@ -1,8 +1,8 @@ { "version": 2, - "dgSpecHash": "bnUESf/Rv6V72tUo+jhmSGhXmC6Pqj7O2CTNWB9EejNBsTYuPhenT/pJ78ztAR8PVDXUh5QMU+FThm53y2XUQg==", + "dgSpecHash": "aDampGwy73k7qtg/YN7p9IeoOxrz4wCzs0qYdTQADvRaI/+G2V69SclPzeFFbFSm7K1+pDPW7S+T49iijnW1Xg==", "success": true, - "projectFilePath": "C:\\Users\\Екатерина\\OneDrive\\Desktop\\РПП\\MotorShip\\MotorShip\\MotorShip.csproj", + "projectFilePath": "C:\\Users\\Екатерина\\OneDrive\\Desktop\\РПП\\MotorShip\\MotorShip\\WarmlyShip.csproj", "expectedPackageFiles": [], "logs": [] } \ No newline at end of file diff --git a/MotorShip/MotorShip.sln b/MotorShip/WarmlyShip.sln similarity index 87% rename from MotorShip/MotorShip.sln rename to MotorShip/WarmlyShip.sln index 3e2fe2d..2e1807f 100644 --- a/MotorShip/MotorShip.sln +++ b/MotorShip/WarmlyShip.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.3.32922.545 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MotorShip", "MotorShip\MotorShip.csproj", "{93B18DF4-AAEC-4934-9DA3-99513CAABB98}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WarmlyShip", "MotorShip\WarmlyShip.csproj", "{93B18DF4-AAEC-4934-9DA3-99513CAABB98}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/ProjectMotorShip/.vs/ProjectEvaluation/projectmotorship.metadata.v5.1 b/ProjectMotorShip/.vs/ProjectEvaluation/projectmotorship.metadata.v5.1 index 629be43..0de01f4 100644 Binary files a/ProjectMotorShip/.vs/ProjectEvaluation/projectmotorship.metadata.v5.1 and b/ProjectMotorShip/.vs/ProjectEvaluation/projectmotorship.metadata.v5.1 differ diff --git a/ProjectMotorShip/.vs/ProjectEvaluation/projectmotorship.projects.v5.1 b/ProjectMotorShip/.vs/ProjectEvaluation/projectmotorship.projects.v5.1 index c863212..3b361b0 100644 Binary files a/ProjectMotorShip/.vs/ProjectEvaluation/projectmotorship.projects.v5.1 and b/ProjectMotorShip/.vs/ProjectEvaluation/projectmotorship.projects.v5.1 differ diff --git a/ProjectMotorShip/.vs/ProjectMotorShip/FileContentIndex/51705c31-706f-418d-a9f1-b302afbed3d6.vsidx b/ProjectMotorShip/.vs/ProjectMotorShip/FileContentIndex/51705c31-706f-418d-a9f1-b302afbed3d6.vsidx new file mode 100644 index 0000000..b782bec Binary files /dev/null and b/ProjectMotorShip/.vs/ProjectMotorShip/FileContentIndex/51705c31-706f-418d-a9f1-b302afbed3d6.vsidx differ diff --git a/ProjectMotorShip/.vs/ProjectMotorShip/FileContentIndex/622eecc9-2eb1-466b-9ef6-eaeb0441dede.vsidx b/ProjectMotorShip/.vs/ProjectMotorShip/FileContentIndex/622eecc9-2eb1-466b-9ef6-eaeb0441dede.vsidx new file mode 100644 index 0000000..5f35f0d Binary files /dev/null and b/ProjectMotorShip/.vs/ProjectMotorShip/FileContentIndex/622eecc9-2eb1-466b-9ef6-eaeb0441dede.vsidx differ diff --git a/ProjectMotorShip/.vs/ProjectMotorShip/FileContentIndex/6f02d9ca-8246-405b-83b2-658385a2aee1.vsidx b/ProjectMotorShip/.vs/ProjectMotorShip/FileContentIndex/6f02d9ca-8246-405b-83b2-658385a2aee1.vsidx new file mode 100644 index 0000000..cde6b8a Binary files /dev/null and b/ProjectMotorShip/.vs/ProjectMotorShip/FileContentIndex/6f02d9ca-8246-405b-83b2-658385a2aee1.vsidx differ diff --git a/ProjectMotorShip/.vs/ProjectMotorShip/FileContentIndex/bb147a51-6eb9-4ce8-ba93-253a44fd9a90.vsidx b/ProjectMotorShip/.vs/ProjectMotorShip/FileContentIndex/bb147a51-6eb9-4ce8-ba93-253a44fd9a90.vsidx new file mode 100644 index 0000000..b98aa2b Binary files /dev/null and b/ProjectMotorShip/.vs/ProjectMotorShip/FileContentIndex/bb147a51-6eb9-4ce8-ba93-253a44fd9a90.vsidx differ diff --git a/ProjectMotorShip/.vs/ProjectMotorShip/v17/.futdcache.v2 b/ProjectMotorShip/.vs/ProjectMotorShip/v17/.futdcache.v2 index fa7746e..651f5d2 100644 Binary files a/ProjectMotorShip/.vs/ProjectMotorShip/v17/.futdcache.v2 and b/ProjectMotorShip/.vs/ProjectMotorShip/v17/.futdcache.v2 differ diff --git a/ProjectMotorShip/.vs/ProjectMotorShip/v17/.suo b/ProjectMotorShip/.vs/ProjectMotorShip/v17/.suo index 7582b12..52307f9 100644 Binary files a/ProjectMotorShip/.vs/ProjectMotorShip/v17/.suo and b/ProjectMotorShip/.vs/ProjectMotorShip/v17/.suo differ