Compare commits

..

6 Commits
main ... lab6

Author SHA1 Message Date
da05da61a1 lab6 2024-02-14 03:43:00 +04:00
5920c92eca lab5 2024-02-13 23:27:44 +04:00
9c7884da80 lab4 2024-02-13 02:15:07 +04:00
9b908da61c lab3 2024-02-08 04:16:08 +04:00
9c923bdc24 lab2 2024-02-07 03:23:17 +04:00
9359766108 lab1 2023-12-30 07:20:49 +04:00
35 changed files with 3616 additions and 76 deletions

View File

@ -0,0 +1,135 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ProjectAircraftCarrier.DrawingObjects;
namespace ProjectAircraftCarrier.MovementStrategy
{
/// <summary>
/// Класс-стратегия перемещения объекта
/// </summary>
public abstract class AbstractStrategy
{
/// <summary>
/// Перемещаемый объект
/// </summary>
private IMoveableObject? _moveableObject;
/// <summary>
/// Статус перемещения
/// </summary>
private Status _state = Status.NotInit;
/// <summary>
/// Ширина поля
/// </summary>
protected int FieldWidth { get; private set; }
/// <summary>
/// Высота поля
/// </summary>
protected int FieldHeight { get; private set; }
/// <summary>
/// Статус перемещения
/// </summary>
public Status GetStatus() { return _state; }
/// <summary>
/// Установка данных
/// </summary>
/// <param name="moveableObject">Перемещаемый объект</param>
/// <param name="width">Ширина поля</param>
/// <param name="height">Высота поля</param>
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;
}
/// <summary>
/// Шаг перемещения
/// </summary>
public void MakeStep()
{
if (_state != Status.InProgress)
{
return;
}
if (IsTargetDestinaion())
{
_state = Status.Finish;
return;
}
MoveToTarget();
}
/// <summary>
/// Перемещение влево
/// </summary>
/// <returns>Результат перемещения (true - удалось переместиться, false - неудача)</returns>
protected bool MoveLeft() => MoveTo(DirectionType.Left);
/// <summary>
/// Перемещение вправо
/// </summary>
/// <returns>Результат перемещения (true - удалось переместиться, false - неудача)</returns>
protected bool MoveRight() => MoveTo(DirectionType.Right);
/// <summary>
/// Перемещение вверх
/// </summary>
/// <returns>Результат перемещения (true - удалось переместиться, false - неудача)</returns>
protected bool MoveUp() => MoveTo(DirectionType.Up);
/// <summary>
/// Перемещение вниз
/// </summary>
/// <returns>Результат перемещения (true - удалось переместиться, false - неудача)</returns>
protected bool MoveDown() => MoveTo(DirectionType.Down);
/// <summary>
/// Параметры объекта
/// </summary>
protected ObjectParameters? GetObjectParameters =>
_moveableObject?.GetObjectPosition;
/// <summary>
/// Шаг объекта
/// </summary>
/// <returns></returns>
protected int? GetStep()
{
if (_state != Status.InProgress)
{
return null;
}
return _moveableObject?.GetStep;
}
/// <summary>
/// Перемещение к цели
/// </summary>
protected abstract void MoveToTarget();
/// <summary>
/// Достигнута ли цель
/// </summary>
/// <returns></returns>
protected abstract bool IsTargetDestinaion();
/// <summary>
/// Попытка перемещения в требуемом направлении
/// </summary>
/// <param name="directionType">Направление</param>
/// <returns>Результат попытки (true - удалось переместиться, false - неудача)</returns>
private bool MoveTo(DirectionType directionType)
{
if (_state != Status.InProgress)
{
return false;
}
if (_moveableObject?.CheckCanMove(directionType) ?? false)
{
_moveableObject.MoveObject(directionType);
return true;
}
return false;
}
}
}

View File

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

View File

@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjectAircraftCarrier
{
/// <summary>
/// Направление перемещения
/// </summary>
public enum DirectionType
{
/// <summary>
/// Вверх
/// </summary>
Up = 1,
/// <summary>
/// Вниз
/// </summary>
Down = 2,
/// <summary>
/// Влево
/// </summary>
Left = 3,
/// <summary>
/// Вправо
/// </summary>
Right = 4
}
}

View File

@ -0,0 +1,98 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ProjectAircraftCarrier.DrawingObjects;
using ProjectAircraftCarrier.Entities;
namespace ProjectAircraftCarrier.DrawingObjects
{
/// <summary>
/// Класс, отвечающий за прорисовку и перемещение объекта-сущности
/// </summary>
internal class DrawingAircraftCarrier : DrawingWarship
{
/// <summary>
/// Конструктор
/// </summary>
/// <param name="speed">Скорость</param>
/// <param name="weight">Вес</param>
/// <param name="bodyColor">Основной цвет</param>
/// <param name="additionalColor">Дополнительный цвет</param>
/// <param name="runway">Признак наличия антикрыла</param>
/// <param name="cabin">Признак наличия гоночной полосы</param>
/// <param name="width">Ширина картинки</param>
/// <param name="height">Высота картинки</param>
public DrawingAircraftCarrier(int speed, double weight, Color bodyColor, Color additionalColor, bool runway, bool cabin, int width, int height) :
base(speed, weight, bodyColor, width, height, 196, 58)
{
if (EntityWarship != null)
{
EntityWarship = new EntityAircraftCarrier(speed, weight, bodyColor, additionalColor, runway, cabin);
}
}
public override void DrawTransport(Graphics g)
{
if (EntityWarship is not EntityAircraftCarrier aircraftCarrier)
{
return;
}
Pen pen = new(Color.Black);
Brush additionalBrush = new
SolidBrush(aircraftCarrier.AdditionalColor);
base.DrawTransport(g);
//впп
if (aircraftCarrier.Runway)
{
Pen penWhite = new Pen(Color.White, 3);
Pen penThinWhite = new Pen(Color.White, 1);
g.DrawLine(penWhite, _startPosX + 4, _startPosY + 14, _startPosX + 114, _startPosY + 1);
g.DrawLine(penWhite, _startPosX + 4, _startPosY + 26, _startPosX + 156, _startPosY + 8);
g.DrawLine(penThinWhite, _startPosX + 3, _startPosY + 20, _startPosX + 148, _startPosY + 3);
}
// кабина
if (aircraftCarrier.Cabin)
{
Point[] PointCabin = {
new Point(_startPosX + 15, _startPosY + 42),
new Point(_startPosX + 17, _startPosY + 41),
new Point(_startPosX + 22, _startPosY + 41),
new Point(_startPosX + 22, _startPosY + 38),
new Point(_startPosX + 25, _startPosY + 38),
new Point(_startPosX + 25, _startPosY + 41),
new Point(_startPosX + 35, _startPosY + 41),
new Point(_startPosX + 35, _startPosY + 38),
new Point(_startPosX + 38, _startPosY + 38),
new Point(_startPosX + 38, _startPosY + 41),
new Point(_startPosX + 43, _startPosY + 41),
new Point(_startPosX + 43, _startPosY + 38),
new Point(_startPosX + 46, _startPosY + 38),
new Point(_startPosX + 46, _startPosY + 41),
new Point(_startPosX + 51, _startPosY + 41),
new Point(_startPosX + 52, _startPosY + 42),
new Point(_startPosX + 52, _startPosY + 45),
new Point(_startPosX + 51, _startPosY + 46),
new Point(_startPosX + 46, _startPosY + 46),
new Point(_startPosX + 46, _startPosY + 49),
new Point(_startPosX + 43, _startPosY + 49),
new Point(_startPosX + 43, _startPosY + 46),
new Point(_startPosX + 38, _startPosY + 46),
new Point(_startPosX + 38, _startPosY + 49),
new Point(_startPosX + 35, _startPosY + 49),
new Point(_startPosX + 35, _startPosY + 46),
new Point(_startPosX + 25, _startPosY + 46),
new Point(_startPosX + 25, _startPosY + 49),
new Point(_startPosX + 22, _startPosY + 49),
new Point(_startPosX + 22, _startPosY + 46),
new Point(_startPosX + 17, _startPosY + 46),
new Point(_startPosX + 15, _startPosY + 45),
};
g.FillPolygon(additionalBrush, PointCabin);
g.DrawPolygon(pen, PointCabin);
}
}
}
}

View File

@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ProjectAircraftCarrier.DrawingObjects;
namespace ProjectAircraftCarrier.MovementStrategy
{
/// <summary>
/// Реализация интерфейса IdrawingObject для работы с объектом drawingCar (паттерн Adapter)
/// </summary>
public class DrawingObjectWarship : IMoveableObject
{
private readonly DrawingWarship? _drawingWarship = null;
public DrawingObjectWarship(DrawingWarship drawingWarship)
{
_drawingWarship = drawingWarship;
}
public ObjectParameters? GetObjectPosition
{
get
{
if (_drawingWarship == null || _drawingWarship.EntityWarship ==
null)
{
return null;
}
return new ObjectParameters(_drawingWarship.GetPosX,
_drawingWarship.GetPosY, _drawingWarship.GetWidth,
_drawingWarship.GetHeight);
}
}
public int GetStep => (int)(_drawingWarship?.EntityWarship?.Step ?? 0);
public bool CheckCanMove(DirectionType direction) =>
_drawingWarship?.CanMove(direction) ?? false;
public void MoveObject(DirectionType direction) =>
_drawingWarship?.MoveTransport(direction);
}
}

View File

@ -0,0 +1,220 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ProjectAircraftCarrier.Entities;
using ProjectAircraftCarrier.MovementStrategy;
namespace ProjectAircraftCarrier.DrawingObjects
{
public class DrawingWarship
{
/// <summary>
/// Класс-сущность
/// </summary>
public EntityWarship? EntityWarship { get; protected set; }
/// <summary>
/// Ширина окна
/// </summary>
private int _pictureWidth;
/// <summary>
/// Высота окна
/// </summary>
private int _pictureHeight;
/// <summary>
/// Левая координата прорисовки авианосца
/// </summary>
protected int _startPosX;
/// <summary>
/// Верхняя кооридната прорисовки авианосца
/// </summary>
protected int _startPosY;
/// <summary>
/// Ширина прорисовки авианосца
/// </summary>
private readonly int _warshipWidth = 196;
/// <summary>
/// Высота прорисовки авианосца
/// </summary>
private readonly int _warshipHeight = 58;
/// <summary>
/// Координата X объекта
/// </summary>
public int GetPosX => _startPosX;
/// <summary>
/// Координата Y объекта
/// </summary>
public int GetPosY => _startPosY;
/// <summary>
/// Ширина объекта
/// </summary>
public int GetWidth => _warshipWidth;
/// <summary>
/// Высота объекта
/// </summary>
public int GetHeight => _warshipHeight;
/// <summary>
/// Конструктор
/// </summary>
/// <param name="speed">Скорость</param>
/// <param name="weight">Вес</param>
/// <param name="bodyColor">Цвет кузова</param>
/// <param name="width">Ширина картинки</param>
/// <param name="height">Высота картинки</param>
/// <returns>true - объект создан, false - проверка не пройдена,нельзя создать объект в этих размерах</returns>
public DrawingWarship(int speed, double weight, Color bodyColor, int width, int height)
{
if (_warshipWidth > width || _warshipHeight > height)
return;
_pictureWidth = width;
_pictureHeight = height;
EntityWarship = new EntityWarship(speed, weight, bodyColor);
}
/// <summary>
/// Конструктор
/// </summary>
/// <param name="speed">Скорость</param>
/// <param name="weight">Вес</param>
/// <param name="bodyColor">Основной цвет</param>
/// <param name="width">Ширина картинки</param>
/// <param name="height">Высота картинки</param>
/// <param name="warshipWidth">Ширина прорисовки автомобиля</param>
/// <param name="warshipHeight">Высота прорисовки автомобиля</param>
protected DrawingWarship(int speed, double weight, Color bodyColor, int
width, int height, int warshipWidth, int warshipHeight)
{
if (_warshipWidth > width || _warshipHeight > height)
return;
_pictureWidth = width;
_pictureHeight = height;
_warshipWidth = warshipWidth;
_warshipHeight = warshipHeight;
EntityWarship = new EntityWarship(speed, weight, bodyColor);
}
/// <summary>
/// Установка позиции
/// </summary>
/// <param name="x">Координата X</param>
/// <param name="y">Координата Y</param>
public void SetPosition(int x, int y)
{
_startPosX = x;
_startPosY = y;
if (_startPosX < 0 || _startPosY < 0)
{
_startPosX = 50;
_startPosY = 50;
}
}
/// <summary>
/// Проверка, что объект может переместится по указанному направлению
/// </summary>
/// <param name="direction">Направление</param>
/// <returns>true - можно переместится по указанному направлению</returns>
public bool CanMove(DirectionType direction)
{
if (EntityWarship == null)
{
return false;
}
return direction switch
{
//влево
DirectionType.Left => _startPosX - EntityWarship.Step > 0,
//вверх
DirectionType.Up => _startPosY - EntityWarship.Step > 0,
// вправо
DirectionType.Right => _startPosX + EntityWarship.Step + _warshipWidth < _pictureWidth,
//вниз
DirectionType.Down => _startPosY + EntityWarship.Step + _warshipHeight < _pictureHeight,
_ => false,
};
}
/// <summary>
/// Изменение направления перемещения
/// </summary>
/// <param name="direction">Направление</param>
public void MoveTransport(DirectionType direction)
{
if (!CanMove(direction) || EntityWarship == null)
{
return;
}
switch (direction)
{
//влево
case DirectionType.Left:
_startPosX -= (int)EntityWarship.Step;
break;
//вверх
case DirectionType.Up:
_startPosY -= (int)EntityWarship.Step;
break;
// вправо
case DirectionType.Right:
_startPosX += (int)EntityWarship.Step;
break;
//вниз
case DirectionType.Down:
_startPosY += (int)EntityWarship.Step;
break;
}
}
/// <summary>
/// Прорисовка объекта
/// </summary>
/// <param name="g"></param>
public virtual void DrawTransport(Graphics g)
{
if (EntityWarship == null)
{
return;
}
Pen pen = new(Color.Black);
Brush br = new SolidBrush(EntityWarship.BodyColor);
//двигатели
Point[] PointEngine1 = {
new Point(_startPosX + 0, _startPosY + 11),
new Point(_startPosX + 2, _startPosY + 11),
new Point(_startPosX + 2, _startPosY + 24),
new Point(_startPosX + 0, _startPosY + 24),
};
Point[] PointEngine2 = {
new Point(_startPosX + 0, _startPosY + 31),
new Point(_startPosX + 2, _startPosY + 31),
new Point(_startPosX + 2, _startPosY + 44),
new Point(_startPosX + 0, _startPosY + 44),
};
Brush brBlack = new SolidBrush(Color.Black);
g.FillPolygon(brBlack, PointEngine1);
g.DrawPolygon(pen, PointEngine1);
g.FillPolygon(brBlack, PointEngine2);
g.DrawPolygon(pen, PointEngine2);
//границы авианосца
Point[] PointBorders = {
new Point(_startPosX + 4, _startPosY + 0),
new Point(_startPosX + 142, _startPosY + 0),
new Point(_startPosX + 196, _startPosY + 29),
new Point(_startPosX + 142, _startPosY + 58),
new Point(_startPosX + 4, _startPosY + 58),
};
Brush brGray = new SolidBrush(Color.Gray);
g.FillPolygon(br, PointBorders);
g.DrawPolygon(pen, PointBorders);
//отсеки
g.DrawRectangle(pen, _startPosX + 98, _startPosY + 18, 10, 23);
g.FillRectangle(brBlack, _startPosX + 99, _startPosY + 19, 9, 22);
g.DrawRectangle(pen, _startPosX + 78, _startPosY + 23, 20, 13);
g.FillRectangle(brBlack, _startPosX + 79, _startPosY + 24, 19, 12);
g.DrawEllipse(pen, _startPosX + 138, _startPosY + 22, 11, 11);
g.FillEllipse(brBlack, _startPosX + 138, _startPosY + 22, 11, 11);
}
/// <summary>
/// Получение объекта IMoveableObject из объекта DrawningCar
/// </summary>
public IMoveableObject GetMoveableObject => new DrawingObjectWarship(this);
}
}

View File

@ -0,0 +1,45 @@
using ProjectAircraftCarrier.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjectAircraftCarrier.Entities
{
/// <summary>
/// Класс-сущность "Спортивный автомобиль"
/// </summary>
public class EntityAircraftCarrier : EntityWarship
{
/// <summary>
/// Дополнительный цвет (для опциональных элементов)
/// </summary>
public Color AdditionalColor { get; private set; }
/// <summary>
/// Признак (опция) наличия антикрыла
/// </summary>
public bool Runway { get; private set; }
/// <summary>
/// Признак (опция) наличия гоночной полосы
/// </summary>
public bool Cabin { get; private set; }
/// <summary>
/// Инициализация полей объекта-класса спортивного автомобиля
/// </summary>
/// <param name="speed">Скорость</param>
/// <param name="weight">Вес автомобиля</param>
/// <param name="bodyColor">Основной цвет</param>
/// <param name="additionalColor">Дополнительный цвет</param>
/// <param name="runway">Признак наличия антикрыла</param>
/// <param name="cabin">Признак наличия гоночной полосы</param>
public EntityAircraftCarrier(int speed, double weight, Color bodyColor, Color additionalColor, bool runway, bool cabin)
: base(speed, weight, bodyColor)
{
AdditionalColor = additionalColor;
Runway = runway;
Cabin = cabin;
}
public void ChangeAddColor(Color color) { AdditionalColor = color; }
}
}

View File

@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjectAircraftCarrier.Entities
{
/// <summary>
/// Класс-сущность "Автомобиль"
/// </summary>
public class EntityWarship
{
/// <summary>
/// Скорость
/// </summary>
public int Speed { get; private set; }
/// <summary>
/// Вес
/// </summary>
public double Weight { get; private set; }
/// <summary>
/// Основной цвет
/// </summary>
public Color BodyColor { get; private set; }
/// <summary>
/// Шаг перемещения автомобиля
/// </summary>
public double Step => (double)Speed * 100 / Weight;
/// <summary>
/// Конструктор с параметрами
/// </summary>
/// <param name="speed">Скорость</param>
/// <param name="weight">Вес автомобиля</param>
/// <param name="bodyColor">Основной цвет</param>
public EntityWarship(int speed, double weight, Color bodyColor)
{
Speed = speed;
Weight = weight;
BodyColor = bodyColor;
}
public void ChangeColor(Color color) { BodyColor = color; }
}
}

View File

@ -0,0 +1,61 @@
using ProjectAircraftCarrier.Entities;
namespace ProjectAircraftCarrier.DrawingObjects
{
/// <summary>
/// Расширение для класса EntityWarship
/// </summary>
public static class ExtentionDrawingWarship
{
/// <summary>
/// Создание объекта из строки
/// </summary>
/// <param name="info">Строка с данными для создания объекта</param>
/// <param name="separatorForObject">Разделитель даннных</param>
/// <param name="width">Ширина</param>
/// <param name="height">Высота</param>
/// <returns>Объект</returns>
public static DrawingWarship? CreateDrawingWarship(this string info,
char separatorForObject, int width, int height)
{
string[] strs = info.Split(separatorForObject);
if (strs.Length == 3)
{
return new DrawingWarship(Convert.ToInt32(strs[0]),
Convert.ToInt32(strs[1]), Color.FromName(strs[2]),
width, height);
}
if (strs.Length == 6)
{
return new DrawingAircraftCarrier(Convert.ToInt32(strs[0]),
Convert.ToInt32(strs[1]), Color.FromName(strs[2]),
Color.FromName(strs[3]), Convert.ToBoolean(strs[4]),
Convert.ToBoolean(strs[5]), width, height);
}
return null;
}
/// <summary>
/// Получение данных для сохранения в файл
/// </summary>
/// <param name="drawingWarship">Сохраняемый объект</param>
/// <param name="separatorForObject">Разделитель даннных</param>
/// <returns>Строка с данными по объекту</returns>
public static string GetDataForSave(this DrawingWarship drawingWarship,
char separatorForObject)
{
var warship = drawingWarship.EntityWarship;
if (warship == null)
{
return string.Empty;
}
var str = $"{warship.Speed}{separatorForObject}{warship.Weight}" +
$"{separatorForObject}{warship.BodyColor.Name}";
if (warship is not EntityAircraftCarrier aircraftCarrier)
{
return str;
}
return $"{str}{separatorForObject}{aircraftCarrier.AdditionalColor.Name}{separatorForObject}{aircraftCarrier.Runway}{separatorForObject}{aircraftCarrier.Cabin}";
}
}
}

View File

@ -1,39 +0,0 @@
namespace AircraftCarrier
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Text = "Form1";
}
#endregion
}
}

View File

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

View File

@ -0,0 +1,205 @@
using System.Windows.Forms;
namespace ProjectAircraftCarrier
{
partial class FormAircraftCarrier
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormAircraftCarrier));
buttonCreateAircraftCarrier = new Button();
buttonLeft = new Button();
buttonRight = new Button();
buttonUp = new Button();
buttonDown = new Button();
pictureBoxAircraftCarrier = new PictureBox();
comboBoxStrategy = new ComboBox();
buttonStep = new Button();
buttonCreateWarship = new Button();
buttonSelectWarship = new Button();
((System.ComponentModel.ISupportInitialize)pictureBoxAircraftCarrier).BeginInit();
SuspendLayout();
//
// buttonCreateAircraftCarrier
//
buttonCreateAircraftCarrier.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
buttonCreateAircraftCarrier.Location = new Point(8, 523);
buttonCreateAircraftCarrier.Margin = new Padding(4, 3, 4, 3);
buttonCreateAircraftCarrier.Name = "buttonCreateAircraftCarrier";
buttonCreateAircraftCarrier.Size = new Size(200, 37);
buttonCreateAircraftCarrier.TabIndex = 0;
buttonCreateAircraftCarrier.Text = "Create Aircraft Carrier";
buttonCreateAircraftCarrier.UseVisualStyleBackColor = true;
buttonCreateAircraftCarrier.Click += ButtonCreateAircraftCarrier_Click;
//
// buttonLeft
//
buttonLeft.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
buttonLeft.BackgroundImage = (Image)resources.GetObject("buttonLeft.BackgroundImage");
buttonLeft.BackgroundImageLayout = ImageLayout.Zoom;
buttonLeft.Location = new Point(969, 523);
buttonLeft.Margin = new Padding(4, 3, 4, 3);
buttonLeft.Name = "buttonLeft";
buttonLeft.Size = new Size(37, 37);
buttonLeft.TabIndex = 1;
buttonLeft.UseVisualStyleBackColor = true;
buttonLeft.Click += ButtonMove_Click;
//
// buttonRight
//
buttonRight.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
buttonRight.BackgroundImage = (Image)resources.GetObject("buttonRight.BackgroundImage");
buttonRight.BackgroundImageLayout = ImageLayout.Zoom;
buttonRight.Location = new Point(1059, 523);
buttonRight.Margin = new Padding(4, 3, 4, 3);
buttonRight.Name = "buttonRight";
buttonRight.Size = new Size(37, 37);
buttonRight.TabIndex = 2;
buttonRight.UseVisualStyleBackColor = true;
buttonRight.Click += ButtonMove_Click;
//
// buttonUp
//
buttonUp.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
buttonUp.BackgroundImage = (Image)resources.GetObject("buttonUp.BackgroundImage");
buttonUp.BackgroundImageLayout = ImageLayout.Zoom;
buttonUp.Location = new Point(1014, 478);
buttonUp.Margin = new Padding(4, 3, 4, 3);
buttonUp.Name = "buttonUp";
buttonUp.Size = new Size(37, 37);
buttonUp.TabIndex = 3;
buttonUp.UseVisualStyleBackColor = true;
buttonUp.Click += ButtonMove_Click;
//
// buttonDown
//
buttonDown.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
buttonDown.BackgroundImage = (Image)resources.GetObject("buttonDown.BackgroundImage");
buttonDown.BackgroundImageLayout = ImageLayout.Zoom;
buttonDown.Location = new Point(1014, 523);
buttonDown.Margin = new Padding(4, 3, 4, 3);
buttonDown.Name = "buttonDown";
buttonDown.Size = new Size(37, 37);
buttonDown.TabIndex = 4;
buttonDown.UseVisualStyleBackColor = true;
buttonDown.Click += ButtonMove_Click;
//
// pictureBoxAircraftCarrier
//
pictureBoxAircraftCarrier.Dock = DockStyle.Fill;
pictureBoxAircraftCarrier.Location = new Point(0, 0);
pictureBoxAircraftCarrier.Margin = new Padding(4, 3, 4, 3);
pictureBoxAircraftCarrier.Name = "pictureBoxAircraftCarrier";
pictureBoxAircraftCarrier.Size = new Size(1103, 567);
pictureBoxAircraftCarrier.SizeMode = PictureBoxSizeMode.CenterImage;
pictureBoxAircraftCarrier.TabIndex = 5;
pictureBoxAircraftCarrier.TabStop = false;
//
// comboBoxStrategy
//
comboBoxStrategy.Anchor = AnchorStyles.Top | AnchorStyles.Right;
comboBoxStrategy.DropDownStyle = ComboBoxStyle.DropDownList;
comboBoxStrategy.FormattingEnabled = true;
comboBoxStrategy.Items.AddRange(new object[] { "Move to center", "Move to border" });
comboBoxStrategy.Location = new Point(923, 12);
comboBoxStrategy.Margin = new Padding(4, 5, 4, 5);
comboBoxStrategy.Name = "comboBoxStrategy";
comboBoxStrategy.Size = new Size(171, 33);
comboBoxStrategy.TabIndex = 6;
//
// buttonStep
//
buttonStep.Anchor = AnchorStyles.Top | AnchorStyles.Right;
buttonStep.Location = new Point(989, 57);
buttonStep.Margin = new Padding(4, 5, 4, 5);
buttonStep.Name = "buttonStep";
buttonStep.Size = new Size(107, 38);
buttonStep.TabIndex = 7;
buttonStep.Text = "Step";
buttonStep.UseVisualStyleBackColor = true;
buttonStep.Click += ButtonStep_Click;
//
// buttonCreateWarship
//
buttonCreateWarship.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
buttonCreateWarship.Location = new Point(216, 523);
buttonCreateWarship.Margin = new Padding(4, 3, 4, 3);
buttonCreateWarship.Name = "buttonCreateWarship";
buttonCreateWarship.Size = new Size(200, 37);
buttonCreateWarship.TabIndex = 8;
buttonCreateWarship.Text = "Create Warship";
buttonCreateWarship.UseVisualStyleBackColor = true;
buttonCreateWarship.Click += ButtonCreateWarship_Click;
//
// buttonSelectWarship
//
buttonSelectWarship.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
buttonSelectWarship.Location = new Point(424, 523);
buttonSelectWarship.Name = "buttonSelectWarship";
buttonSelectWarship.Size = new Size(200, 37);
buttonSelectWarship.TabIndex = 9;
buttonSelectWarship.Text = "Select Warship";
buttonSelectWarship.UseVisualStyleBackColor = true;
buttonSelectWarship.Click += ButtonSelectWarhip_Click;
//
// FormAircraftCarrier
//
AutoScaleDimensions = new SizeF(10F, 25F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(1103, 567);
Controls.Add(buttonSelectWarship);
Controls.Add(buttonCreateWarship);
Controls.Add(buttonStep);
Controls.Add(comboBoxStrategy);
Controls.Add(buttonDown);
Controls.Add(buttonUp);
Controls.Add(buttonRight);
Controls.Add(buttonLeft);
Controls.Add(buttonCreateAircraftCarrier);
Controls.Add(pictureBoxAircraftCarrier);
Margin = new Padding(4, 3, 4, 3);
Name = "FormAircraftCarrier";
StartPosition = FormStartPosition.CenterScreen;
Text = "Aircraft Carrier";
((System.ComponentModel.ISupportInitialize)pictureBoxAircraftCarrier).EndInit();
ResumeLayout(false);
}
#endregion
private PictureBox pictureBoxAircraftCarrier;
private Button buttonCreateAircraftCarrier;
private Button buttonUp;
private Button buttonLeft;
private Button buttonDown;
private Button buttonRight;
private ComboBox comboBoxStrategy;
private Button buttonStep;
private Button buttonCreateWarship;
private Button buttonSelectWarship;
}
}

View File

@ -0,0 +1,168 @@
using ProjectAircraftCarrier.MovementStrategy;
using ProjectAircraftCarrier.DrawingObjects;
using System.Windows.Forms;
namespace ProjectAircraftCarrier
{
public partial class FormAircraftCarrier : Form
{
/// <summary>
/// Ïîëå-îáúåêò äëÿ ïðîðèñîâêè îáúåêòà
/// </summary>
private DrawingWarship? _drawingWarship;
/// <summary>
/// Ñòðàòåãèÿ ïåðåìåùåíèÿ
/// </summary>
private AbstractStrategy? _abstractStrategy;
/// <summary>
/// Âûáðàííûé àâòîìîáèëü
/// </summary>
public DrawingWarship? SelectedWarship { get; private set; }
/// <summary>
/// Èíèöèàëèçàöèÿ ôîðìû
/// </summary>
public FormAircraftCarrier()
{
InitializeComponent();
SelectedWarship = null;
_abstractStrategy = null;
}
/// <summary>
/// Ìåòîä ïðîðèñîâêè àâèàíîñöà
/// </summary>
private void Draw()
{
if (_drawingWarship == null)
{
return;
}
Bitmap bmp = new(pictureBoxAircraftCarrier.Width, pictureBoxAircraftCarrier.Height);
Graphics gr = Graphics.FromImage(bmp);
_drawingWarship.DrawTransport(gr);
pictureBoxAircraftCarrier.Image = bmp;
}
/// <summary>
/// Îáðàáîòêà íàæàòèÿ êíîïêè "Ñîçäàòü"
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ButtonCreateAircraftCarrier_Click(object sender, EventArgs e)
{
Random random = new();
Color bodyColor = Color.FromArgb(random.Next(0, 256),
random.Next(0, 256), random.Next(0, 256));
ColorDialog dialog = new();
if (dialog.ShowDialog() == DialogResult.OK)
{
bodyColor = dialog.Color;
}
Color additColor = Color.FromArgb(random.Next(0, 256),
random.Next(0, 256), random.Next(0, 256));
if (dialog.ShowDialog() == DialogResult.OK)
{
additColor = dialog.Color;
}
_drawingWarship = new DrawingAircraftCarrier(random.Next(100, 300),
random.Next(1000, 3000), bodyColor,
additColor, Convert.ToBoolean(random.Next(0, 2)),
Convert.ToBoolean(random.Next(0, 2)),
pictureBoxAircraftCarrier.Width, pictureBoxAircraftCarrier.Height);
_drawingWarship.SetPosition(random.Next(10, 100), random.Next(10, 100));
Draw();
}
/// <summary>
/// Îáðàáîòêà íàæàòèÿ êíîïêè "Create Warship"
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ButtonCreateWarship_Click(object sender, EventArgs e)
{
Random random = new();
Color color = Color.FromArgb(random.Next(0, 256),
random.Next(0, 256), random.Next(0, 256));
ColorDialog dialog = new();
if (dialog.ShowDialog() == DialogResult.OK)
{
color = dialog.Color;
}
_drawingWarship = new DrawingWarship(random.Next(100, 300),
random.Next(1000, 3000), color,
pictureBoxAircraftCarrier.Width, pictureBoxAircraftCarrier.Height);
_drawingWarship.SetPosition(random.Next(10, 100), random.Next(10, 100));
Draw();
}
/// <summary>
/// Îáðàáîòêà íàæàòèÿ êíîïîê äâèæåíèÿ
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ButtonMove_Click(object sender, EventArgs e)
{
if (_drawingWarship == null)
{
return;
}
string name = ((Button)sender)?.Name ?? string.Empty;
switch (name)
{
case "buttonUp":
_drawingWarship.MoveTransport(DirectionType.Up);
break;
case "buttonDown":
_drawingWarship.MoveTransport(DirectionType.Down);
break;
case "buttonLeft":
_drawingWarship.MoveTransport(DirectionType.Left);
break;
case "buttonRight":
_drawingWarship.MoveTransport(DirectionType.Right);
break;
}
Draw();
}
private void ButtonSelectWarhip_Click(object sender, EventArgs e)
{
SelectedWarship = _drawingWarship;
DialogResult = DialogResult.OK;
}
/// <summary>
/// Îáðàáîòêà íàæàòèÿ êíîïêè "Øàã"
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ButtonStep_Click(object sender, EventArgs e)
{
if (_drawingWarship == null)
{
return;
}
if (comboBoxStrategy.Enabled)
{
_abstractStrategy = comboBoxStrategy.SelectedIndex switch
{
0 => new MoveToCenter(),
1 => new MoveToBorder(),
_ => null,
};
if (_abstractStrategy == null)
{
return;
}
_abstractStrategy.SetData(new DrawingObjectWarship(_drawingWarship), pictureBoxAircraftCarrier.Width, pictureBoxAircraftCarrier.Height);
comboBoxStrategy.Enabled = false;
}
if (_abstractStrategy == null)
{
return;
}
_abstractStrategy.MakeStep();
Draw();
if (_abstractStrategy.GetStatus() == Status.Finish)
{
comboBoxStrategy.Enabled = true;
_abstractStrategy = null;
}
}
}
}

View File

@ -0,0 +1,510 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="buttonLeft.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAA5gAAAOYBAMAAABC5kGOAAAABGdBTUEAALGPC/xhBQAAABJQTFRF5ubm
////AAAAIyMjycnJiIiI9drrEwAAAAlwSFlzAAAOvQAADr0BR/uQrQAAE2hJREFUeNrtncty01wWRqUK
nkvV9gvIZE6bMCdtmJME3v9VmkC4JU4sW/t2vqxdXdX/YqKtvUqfFZ0juxvHoftZ488Cm0VkIhOsiMhE
JlgRv1f/8E+gADIJIWQSQsgkhJBJCCGTEEImIYRMQgiZhBAyCSFkEkLIJISQSQghkxBCJiGDLAbqIDKR
CVZEZCITrIjIRCZYEZGJTLAiIhOZYEVEJjLBiohMZIIVsWMxUAqZhBAyCSFkEkLIJISQSQghkxBCJiGE
TEIImYQQMgkhZBJCyCSEkEkIIZOQQRYDdRCZyAQrIjKRCVZEZCITrIjIRCZYEZGJTLAiIhOZYEVEJjLB
itixGCiFTEIImYQQMgkhZBJCyCSEkEkIIZMQQiYhhExCCJmEEDIJIWQSQsgkhJBJyCCLgTqITGSCFRGZ
yAQrIjKRCVZEZCITrIjIRCZYEZGJTLAiIhOZYEXsWAyUQiYhhExCCJmEEDIJIWQSQsgkhJBJCCGTEEIm
IYRMQgiZhBAyCSFkEkLIJGSQxUAdRCYywYqITGSCFRGZyAQrIjKRCVZEZCITrIjIRCZYEZGJTLAidiwG
SiGTEEImIYRMQgiZhBAyCSFkEkLIJISQSQghkxBCJiGETEIImY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CGTEEImIYRMQgiZhBAyCRlkMVAHkYlMsCIiE5lgRUQmMsGK
iExkghURmcgEKyIykQlWRGQiE6yIHYuBUsgkhJBJCCGTEEImIYRMQgiZhBAyCSFkEkLIJISQSQghkxBC
JiGETEIImYQMshiog8hEJlgRkYlMsCIiE5lgRUQmMsGKiExkghURmcgEKyIykQlWxI7FQClkEkLIJISQ
SQghkxBCJiGETEIImYQQMgkhZBJCyCSEkEkIIZMQQiYhhExCBlkM1EFkIhOsiMhEJlgRkYlMsCIiE5lg
RUQmMsGKiExkghURmcgEK2LHYqAUMgkhZBJCyCSEkEkIIZMQQiYhhExCCJmEEDIJIWQSQsgkhJBJCCGT
EEImIYMsBuogMpEJVkRkIhOsiMhEJlgRkYlMsCIiE5lgRUQmMsGKiExkghWxYzFQCpmEEDIJIWQSQsgk
hJBJCCGTEEImIYRMQgiZhBAyCSFkEkLIJISQSQghk5BBFgN1EJnIBCsiMpEJVkRkIhOsiMhEJlgRkYlM
sCIiE5lgRUQmMsGK2LEYKIVMQgiZhBAyCSFkEkLIJISQSQghkxBCJiGETEIImYQQMgkhZBJCyCSEkEnI
IIuBOohMZIIVEZnIBCsiMpEJVkRkIhOsiMhEJlgRkYlMsCIiE5lgRexYDJRCJiGETEIImYQQMgkhZBJC
yCSEkEkIIZMQQiYhhExCCJmEEDIJIWQSQsgkNHAc/w9ZWidsekADXAAAAABJRU5ErkJggg==
</value>
</data>
<data name="buttonRight.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAA5gAAAOYBAMAAABC5kGOAAAABGdBTUEAALGPC/xhBQAAABJQTFRF5ubm
////AAAAIyMjycnJiIiI9drrEwAAFf5JREFUeNrtncuS28a2RBNhaU7ElX4AOJjrSuDcbNlzUpb//1dO
89G2xNMPgqgC9k6tDE9WhxxRlSsAslm7CbXnbHQOmBlpwghpwghpwghpwghpwghpwghpwghpwghpwghp
wghpwgh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+PHeTzb1B5V7+DPx47XJokZkVP3x+5p1s7g0q9/Ln4Ldn3snm3pFy
L38O/nyf3RrsSLmXPwu/Xd9kkZkXP/7wqvnJYUfKvfx5+PXqJovMzPjX028lO4sdKffy5+Kfpzvtduex
I+Ve/mz84++//v7eCJkO2Jx/hkwwGP6y55mWSBNGSBNGSBNGSBNGSBNGSBNGSBNGSBNGSBNGSBNGSBNG
SBNGSBNGSBNmKA4DLVA04YOiCR8UTfigaMIHRRM+KJrwQdGED4omfFA04YOiCR8UTfigaMIHRRM+KJrw
QQ4DnZAmjJAmjJAmjJAmjJAmjJAmjJAmjJAmjJAmjJAmjJAmjJAmjJAmjJAmzFAcBlqgaMIHRRM+KJrw
QdGED4omfFA04YOiCR8UTfigaMIHRRM+KJrwQdGED4omfFA04YMcBjohTRghTRghTRghTRghTRghTRgh
TRghTRghTRghTRghTRghTRghTRghTZihOAy0QNGED4omfFA04YOiCR8UTfigaMIHRRM+KJrwQdGED4om
fFA04YOiCR8UTfigaMIHOQx0QpowQpowQpowQpowQpowQpowQpowQpowQpowQpowQpowQpowQpowQpow
Q3EYaIGiCR8UTfigaMIHRRM+KJrwQdGED4omfFA04YOiCR8UTfigaMIHRRM+KJrwQdGED3IY6IQ0YYQ0
YYQ0YYQ0YYQ0YYQ0YYQ0YYQ0YYQ0YYQ0YYQ0YYQ0YYQ0YYQ0YYbiMNACRRM+KJrwQdGED4omfFA04YOi
CR8UTfigaMIHRRM+KJrwQdGED4omfFA04YOiCR/kMNAJacIIacIIacIIacIIacIIacIIacIIacIIacII
acIIacIIacIIacIIacIMxWGgBYomfFA04YOiCR8UTfigaMIHRRM+KJrwQdGED4omfFA04YOiCR8UTfig
aMIHRRM+yGGgE9KEEdKEEdKEEdKEEdKEEdKEEdKEEdKEEdKEEdKEEdKEEdKEEdKEEdKEGYrDQAsUTfig
aMIHRRM+KJpwwbb9L4jsPs2xdH95AAAAAElFTkSuQmCC
</value>
</data>
<data name="buttonUp.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAA5gAAAOYBAMAAABC5kGOAAAABGdBTUEAALGPC/xhBQAAABJQTFRF5ubm
////AAAAIyMjycnJiIiI9drrEwAAAAlwSFlzAAAOvQAADr0BR/uQrQAAFo9JREFUeNrtnc162zgSRYuf
23vqG+kFSHOvdpR9nHT2ktL9/q8yhghIsiPFtswf3MK5M5ujzRTrDBCAIGmLqRZ9QGE0OuEHjU74QaMT
ftDohB+0+EsdfwKVkU44QjrhCOmEI6QTjpBOOEI64QjphCOkE46QTjhCOuEI6YQjpBOOkE44QjrhDI3D
QBdodMIPGp3wg0Yn/KDRCT9odMIPGp3wg0Yn/KDRCT9odMIPGp3wg0Yn/KDRCT9odMIPGp3wgxwGekI6
4QjphCOkE46QTjhCOuEI6YQjpBOOkE44QjrhCOmEI6QTjpBOOEI64QjphDM0DgNdoNEJP2h0wg8anfCD
Rif8oNEJP2h0wg8anfCDRif8oNEJP2h0wg8anfCDRif8oNEJP2h0wg9yGOgJ6YQjpBOOkE44QjrhCOmE
I6QTjpBOOMISrvWvn/98S+z6el1f3AGXv740Tfv1W+31Ak/o+uKeU62+tE1Iu63NkKmM1XLf9Gm7JzNk
SuOv5pivlSFTGKv75ixhonV9va4vzmx/LrPzf72HOD3uW567bNodh9PC+P2FzOYBmbpYP76U2VbIlMVV
8yo7ZMri/rXMDpmquGx+y5Pn6zXPF3f3u8x17fh6zRxf3OPvMlvP12uOL27VXMjW7/W6lrm/JLOr3V6v
Z5nLx0sy2yev1+ta5t1Fmc2mdnq9nmVenmX7u+3IFMP75kq2Pq/Xs8zqxzWZh3nWp8z4i7vzvfrxmszW
5fW6PpxeNVezWyBTC/fXZXYLZErh8rrL560mMqXw7g8ymzUypXD/J5kdMpVw1fwxO2QK4fc/y3xApg5e
32T2aStkyuD/mjeyQ6YM7t+S2SFTBZfNm3nydL1H9HU1Pf54W+amdnS9R/R1NT0+vi2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71GHT7hMzJsfoxjsxNjczpcZyh2X4zZM6AowzNMDCROT0ufg3v8uuTajfEZVbLwW1+/VbLdmMh+xbY
Aau//hv03832v0q4G2bSMq2q//n5X8jPw3+PuQ3//aeS7oa4TLN6MVysVu+GePkgMpEJ5o50whHSCUdI
JxwhnXCEdMIR0glHSCccIZ1whHTCGZrsCR7o5nAafIlGJ/yg0Qk/aHTCDxqd8INGJ/yg0Qk/aHTCDxqd
8INGJ/yg0Qk/aHTCDxqd8INGJ/wgh4GekE44QjrhCOmEI6QTjpBOOEI64QjphCOkE46QTjhCOuEI6YQj
pBOOkE44QjrhDI3DQBdodMIPGp3wg0Yn/KDRCT9odMIPGp3wg0Yn/KDRCT9odMIPGp3wg0Yn/KDRCT9o
dMIPGp3wgxwGekI64QjphCOkE46QTjhCOuEI6YQjpBOOkE44QjrhCOmEI6QTjpBOOEI64QjphBc0+z+G
ED9UnMHLKAAAAABJRU5ErkJggg==
</value>
</data>
<data name="buttonDown.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAA5gAAAOYBAMAAABC5kGOAAAABGdBTUEAALGPC/xhBQAAABJQTFRF5ubm
////AAAAIyMjycnJiIiI9drrEwAAAAlwSFlzAAAOvQAADr0BR/uQrQAAFRpJREFUeNrt3cGS2zYWRmGw
4uzJiv0CTXGvtuV9mEn2ouO8/6tMS6Laduva3ZJI4N4fRzWbk8WMiW+IgAAlp5Sa7vRJpw8ZORkJoWQk
hJKREEpGQigZCaFkJISSkRBKRkIoGQmhZCSEkpEQSkZCKBkJoWQkZLLr2vkfzf+EDJtggkl6TDDBJD0m
mGCSHhNMMEmPCSaYpMcEE0zSY4IJJukxE4eBUslICCUjIZSMhFAyEkLJSAglIyGUjIRQMhJCyUgIJSMh
lIyEUDISQslICCUjIZMcBuokmGCSHhNMMEmPCSaYpMcEE0zSY4IJJukxwQST9Jhggkl6zMRhoFQyEkLJ
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
CGbU/HK5/AEzan64XP6AGTVfvth13GMHM2i+eLFrI3eBP6Q45oePL5c/0piy55mn/GEJNOhfr/LFNT/s
Au3blMCMm+2/3yw/K17gi5S+uPT+y/lfm8N8XgJm2Gx+P2F+/DS1kheYKsJMzbt/nzg/fR5VL7AmzKd6
9/fXP4UvsCbMqpKREEpGQigZCaFkJISSkRBKRkIoGQmZ1D7PrCvBBJP0mGCCSXpMMMEkPSaYYJIeE0ww
SY8JJpikxwQTTNJjJg4DpZKREEpGQigZCaFkJISSkRBKRkIoGQmhZCSEkpEQSkZCKBkJoWQkhJKREEpG
QiY5DNRJMMEkPSaYYJIeE0wwSY8JJpikxwQTTNJjggkm6THBBJP0mInDQKlkJISSkRBKRkIoGQmhZCSE
kpEQSkZCKBkJoWQkhJKREEpGQigZCaFkJISSkZBJDgN1EkwwSY8JJpikv0zp/814JuW3a02NAAAAAElF
TkSuQmCC
</value>
</data>
</root>

View File

@ -0,0 +1,254 @@
namespace ProjectAircraftCarrier
{
partial class FormWarshipCollection
{
/// <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()
{
groupBoxCollectionTools = new GroupBox();
groupBoxCollectionSets = new GroupBox();
textBoxStorageName = new TextBox();
buttonDelObject = new Button();
buttonAddObject = new Button();
listBoxStorages = new ListBox();
maskedTextBoxNumber = new MaskedTextBox();
buttonRefreshCollection = new Button();
buttonRemoveWarship = new Button();
buttonAddWarship = new Button();
pictureBoxCollection = new PictureBox();
menuStrip = new MenuStrip();
fileToolStripMenuItem = new ToolStripMenuItem();
saveToolStripMenuItem = new ToolStripMenuItem();
loadToolStripMenuItem = new ToolStripMenuItem();
openFileDialog = new System.Windows.Forms.OpenFileDialog();
saveFileDialog = new System.Windows.Forms.SaveFileDialog();
groupBoxCollectionTools.SuspendLayout();
groupBoxCollectionSets.SuspendLayout();
((System.ComponentModel.ISupportInitialize)pictureBoxCollection).BeginInit();
menuStrip.SuspendLayout();
SuspendLayout();
//
// groupBoxCollectionTools
//
groupBoxCollectionTools.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Right;
groupBoxCollectionTools.Controls.Add(groupBoxCollectionSets);
groupBoxCollectionTools.Controls.Add(maskedTextBoxNumber);
groupBoxCollectionTools.Controls.Add(buttonRefreshCollection);
groupBoxCollectionTools.Controls.Add(buttonRemoveWarship);
groupBoxCollectionTools.Controls.Add(buttonAddWarship);
groupBoxCollectionTools.Location = new Point(893, 37);
groupBoxCollectionTools.Margin = new Padding(4, 5, 4, 5);
groupBoxCollectionTools.Name = "groupBoxCollectionTools";
groupBoxCollectionTools.Padding = new Padding(4, 5, 4, 5);
groupBoxCollectionTools.Size = new Size(247, 709);
groupBoxCollectionTools.TabIndex = 0;
groupBoxCollectionTools.TabStop = false;
groupBoxCollectionTools.Text = "Tools";
//
// groupBoxCollectionSets
//
groupBoxCollectionSets.Controls.Add(textBoxStorageName);
groupBoxCollectionSets.Controls.Add(buttonDelObject);
groupBoxCollectionSets.Controls.Add(buttonAddObject);
groupBoxCollectionSets.Controls.Add(listBoxStorages);
groupBoxCollectionSets.Location = new Point(9, 32);
groupBoxCollectionSets.Name = "groupBoxCollectionSets";
groupBoxCollectionSets.Size = new Size(230, 323);
groupBoxCollectionSets.TabIndex = 5;
groupBoxCollectionSets.TabStop = false;
groupBoxCollectionSets.Text = "Sets";
//
// textBoxStorageName
//
textBoxStorageName.Location = new Point(6, 30);
textBoxStorageName.Name = "textBoxStorageName";
textBoxStorageName.Size = new Size(218, 31);
textBoxStorageName.TabIndex = 4;
//
// buttonDelObject
//
buttonDelObject.Location = new Point(6, 276);
buttonDelObject.Name = "buttonDelObject";
buttonDelObject.Size = new Size(218, 41);
buttonDelObject.TabIndex = 3;
buttonDelObject.Text = "Delete Set";
buttonDelObject.UseVisualStyleBackColor = true;
buttonDelObject.Click += ButtonDelObject_Click;
//
// buttonAddObject
//
buttonAddObject.Location = new Point(6, 67);
buttonAddObject.Name = "buttonAddObject";
buttonAddObject.Size = new Size(218, 43);
buttonAddObject.TabIndex = 2;
buttonAddObject.Text = "Add set";
buttonAddObject.UseVisualStyleBackColor = true;
buttonAddObject.Click += ButtonAddObject_Click;
//
// listBoxStorages
//
listBoxStorages.FormattingEnabled = true;
listBoxStorages.ItemHeight = 25;
listBoxStorages.Location = new Point(6, 116);
listBoxStorages.Name = "listBoxStorages";
listBoxStorages.Size = new Size(218, 154);
listBoxStorages.TabIndex = 1;
listBoxStorages.SelectedIndexChanged += ListBoxObjects_SelectedIndexChanged;
//
// maskedTextBoxNumber
//
maskedTextBoxNumber.Location = new Point(56, 468);
maskedTextBoxNumber.Margin = new Padding(4, 5, 4, 5);
maskedTextBoxNumber.Name = "maskedTextBoxNumber";
maskedTextBoxNumber.Size = new Size(141, 31);
maskedTextBoxNumber.TabIndex = 4;
maskedTextBoxNumber.Text = "_";
//
// buttonRefreshCollection
//
buttonRefreshCollection.Location = new Point(9, 654);
buttonRefreshCollection.Margin = new Padding(4, 5, 4, 5);
buttonRefreshCollection.Name = "buttonRefreshCollection";
buttonRefreshCollection.Size = new Size(230, 45);
buttonRefreshCollection.TabIndex = 3;
buttonRefreshCollection.Text = "Refresh collection";
buttonRefreshCollection.UseVisualStyleBackColor = true;
buttonRefreshCollection.Click += ButtonRefreshCollection_Click;
//
// buttonRemoveWarship
//
buttonRemoveWarship.Location = new Point(9, 509);
buttonRemoveWarship.Margin = new Padding(4, 5, 4, 5);
buttonRemoveWarship.Name = "buttonRemoveWarship";
buttonRemoveWarship.Size = new Size(230, 45);
buttonRemoveWarship.TabIndex = 2;
buttonRemoveWarship.Text = "Remove warship";
buttonRemoveWarship.UseVisualStyleBackColor = true;
buttonRemoveWarship.Click += ButtonRemoveWarship_Click;
//
// buttonAddWarship
//
buttonAddWarship.Location = new Point(9, 413);
buttonAddWarship.Margin = new Padding(4, 5, 4, 5);
buttonAddWarship.Name = "buttonAddWarship";
buttonAddWarship.Size = new Size(230, 45);
buttonAddWarship.TabIndex = 0;
buttonAddWarship.Text = "Add warship";
buttonAddWarship.UseVisualStyleBackColor = true;
buttonAddWarship.Click += ButtonAddWarship_Click;
//
// pictureBoxCollection
//
pictureBoxCollection.Location = new Point(0, 37);
pictureBoxCollection.Margin = new Padding(4, 5, 4, 5);
pictureBoxCollection.Name = "pictureBoxCollection";
pictureBoxCollection.Size = new Size(893, 710);
pictureBoxCollection.TabIndex = 1;
pictureBoxCollection.TabStop = false;
//
// menuStrip1
//
menuStrip.ImageScalingSize = new Size(24, 24);
menuStrip.Items.AddRange(new ToolStripItem[] { fileToolStripMenuItem });
menuStrip.Location = new Point(0, 0);
menuStrip.Name = "menuStrip1";
menuStrip.Size = new Size(1143, 33);
menuStrip.TabIndex = 2;
menuStrip.Text = "menuStrip1";
//
// fileToolStripMenuItem
//
fileToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] { saveToolStripMenuItem, loadToolStripMenuItem });
fileToolStripMenuItem.Name = "fileToolStripMenuItem";
fileToolStripMenuItem.Size = new Size(54, 29);
fileToolStripMenuItem.Text = "File";
//
// saveToolStripMenuItem
//
saveToolStripMenuItem.Name = "saveToolStripMenuItem";
saveToolStripMenuItem.Size = new Size(270, 34);
saveToolStripMenuItem.Text = "Save";
saveToolStripMenuItem.Click += SaveToolStripMenuItem_Click;
//
// loadToolStripMenuItem
//
loadToolStripMenuItem.Name = "loadToolStripMenuItem";
loadToolStripMenuItem.Size = new Size(270, 34);
loadToolStripMenuItem.Text = "Load";
loadToolStripMenuItem.Click += LoadToolStripMenuItem_Click;
//
// openFileDialog
//
openFileDialog.Filter = "txt file | *.txt";
//
// saveFileDialog
//
saveFileDialog.Filter = "txt file | *.txt";
//
// FormWarshipCollection
//
AutoScaleDimensions = new SizeF(10F, 25F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(1143, 750);
Controls.Add(pictureBoxCollection);
Controls.Add(groupBoxCollectionTools);
Controls.Add(menuStrip);
MainMenuStrip = menuStrip;
Margin = new Padding(4, 5, 4, 5);
Name = "FormWarshipCollection";
Text = "Warship Collection";
groupBoxCollectionTools.ResumeLayout(false);
groupBoxCollectionTools.PerformLayout();
groupBoxCollectionSets.ResumeLayout(false);
groupBoxCollectionSets.PerformLayout();
((System.ComponentModel.ISupportInitialize)pictureBoxCollection).EndInit();
menuStrip.ResumeLayout(false);
menuStrip.PerformLayout();
ResumeLayout(false);
PerformLayout();
}
#endregion
private GroupBox groupBoxCollectionTools;
private Button buttonRefreshCollection;
private Button buttonRemoveWarship;
private Button buttonAddWarship;
private PictureBox pictureBoxCollection;
private MaskedTextBox maskedTextBoxNumber;
private GroupBox groupBoxCollectionSets;
private ListBox listBoxStorages;
private Button buttonDelObject;
private Button buttonAddObject;
private TextBox textBoxStorageName;
private MenuStrip menuStrip;
private ToolStripMenuItem fileToolStripMenuItem;
private ToolStripMenuItem saveToolStripMenuItem;
private ToolStripMenuItem loadToolStripMenuItem;
private OpenFileDialog openFileDialog;
private SaveFileDialog saveFileDialog;
}
}

View File

@ -0,0 +1,228 @@
using ProjectAircraftCarrier.DrawingObjects;
using ProjectAircraftCarrier.Generics;
using ProjectAircraftCarrier.MovementStrategy;
using System.Windows.Forms;
namespace ProjectAircraftCarrier
{
/// <summary>
/// Форма для работы с набором объектов класса DrawningCar
/// </summary>
public partial class FormWarshipCollection : Form
{
/// <summary>
/// Набор объектов
/// </summary>
private readonly WarshipsGenericStorage _storage;
/// <summary>
/// Конструктор
/// </summary>
public FormWarshipCollection()
{
InitializeComponent();
_storage = new WarshipsGenericStorage(pictureBoxCollection.Width,
pictureBoxCollection.Height);
}
/// <summary>
/// Заполнение listBoxObjects
/// </summary>
private void ReloadObjects()
{
int index = listBoxStorages.SelectedIndex;
listBoxStorages.Items.Clear();
for (int i = 0; i < _storage.Keys.Count; i++)
{
listBoxStorages.Items.Add(_storage.Keys[i]);
}
if (listBoxStorages.Items.Count > 0 && (index == -1 || index
>= listBoxStorages.Items.Count))
{
listBoxStorages.SelectedIndex = 0;
}
else if (listBoxStorages.Items.Count > 0 && index > -1 &&
index < listBoxStorages.Items.Count)
{
listBoxStorages.SelectedIndex = index;
}
}
/// <summary>
/// Добавление набора в коллекцию
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ButtonAddObject_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(textBoxStorageName.Text))
{
MessageBox.Show("Not all data is filled in", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
_storage.AddSet(textBoxStorageName.Text);
ReloadObjects();
}
/// <summary>
/// Выбор набора
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ListBoxObjects_SelectedIndexChanged(object sender,
EventArgs e)
{
pictureBoxCollection.Image =
_storage[listBoxStorages.SelectedItem?.ToString() ??
string.Empty]?.ShowWarships();
}
/// <summary>
/// Удаление набора
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ButtonDelObject_Click(object sender, EventArgs e)
{
if (listBoxStorages.SelectedIndex == -1)
{
return;
}
if (MessageBox.Show($"Delete an object" +
$"{ listBoxStorages.SelectedItem}?",
"Deletion", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
== DialogResult.Yes)
{
_storage.DelSet(listBoxStorages.SelectedItem.ToString()
?? string.Empty);
ReloadObjects();
}
}
/// <summary>
/// Добавление объекта в набор
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ButtonAddWarship_Click(object sender, EventArgs e)
{
if (listBoxStorages.SelectedIndex == -1)
{
return;
}
var obj = _storage[listBoxStorages.SelectedItem.ToString() ??
string.Empty];
if (obj == null)
{
return;
}
FormWarshipConfig form = new();
form.Show();
Action<DrawingWarship>? warshipDelegate = new((warship) => {
if (obj + warship)
{
MessageBox.Show("Object added");
pictureBoxCollection.Image = obj.ShowWarships();
}
else
{
MessageBox.Show("Failed to add an object");
}
});
form.AddEvent(warshipDelegate);
}
/// <summary>
/// Удаление объекта из набора
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ButtonRemoveWarship_Click(object sender, EventArgs e)
{
if (listBoxStorages.SelectedIndex == -1)
{
return;
}
var obj = _storage[listBoxStorages.SelectedItem.ToString() ??
string.Empty];
if (obj == null)
{
return;
}
if (MessageBox.Show("Delete an object?", "Deletion",
MessageBoxButtons.YesNo, MessageBoxIcon.Question) ==
DialogResult.No)
{
return;
}
int pos = Convert.ToInt32(maskedTextBoxNumber.Text);
if (obj - pos != null)
{
MessageBox.Show("Object deleted");
pictureBoxCollection.Image = obj.ShowWarships();
}
else
{
MessageBox.Show("Failed to delete an object");
}
}
/// <summary>
/// Обновление рисунка по набору
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ButtonRefreshCollection_Click(object sender, EventArgs e)
{
if (listBoxStorages.SelectedIndex == -1)
{
return;
}
var obj = _storage[listBoxStorages.SelectedItem.ToString() ??
string.Empty];
if (obj == null)
{
return;
}
pictureBoxCollection.Image = obj.ShowWarships();
}
/// <summary>
/// Обработка нажатия "Сохранение"
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void SaveToolStripMenuItem_Click(object sender, EventArgs e)
{
if (saveFileDialog.ShowDialog() == DialogResult.OK)
{
if (_storage.SaveData(saveFileDialog.FileName))
{
MessageBox.Show("Save was successful", "Result",
MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
MessageBox.Show("Not preserved", "Result",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
/// <summary>
/// Обработка нажатия "Загрузка"
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void LoadToolStripMenuItem_Click(object sender, EventArgs e)
{
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
if (_storage.LoadData(openFileDialog.FileName))
{
MessageBox.Show("Load was successful",
"Result", MessageBoxButtons.OK, MessageBoxIcon.Information);
foreach (var collection in _storage.Keys)
{
listBoxStorages.Items.Add(collection);
}
}
else
{
MessageBox.Show("Not loaded", "Result",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}
}

View File

@ -0,0 +1,123 @@
<?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>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@ -0,0 +1,370 @@
namespace ProjectAircraftCarrier
{
partial class FormWarshipConfig
{
/// <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()
{
groupBoxCreationParameters = new GroupBox();
labelModifiedObject = new Label();
labelSimpleObject = new Label();
groupBoxCreationColors = new GroupBox();
panelBlack = new Panel();
panelWhite = new Panel();
panelPurple = new Panel();
panelBlue = new Panel();
panelGreen = new Panel();
panelRed = new Panel();
panelGray = new Panel();
panelYellow = new Panel();
checkBoxCabin = new CheckBox();
checkBoxRunway = new CheckBox();
numericUpDownWeight = new NumericUpDown();
labelSpeed = new Label();
numericUpDownSpeed = new NumericUpDown();
labelWeight = new Label();
pictureBoxObject = new PictureBox();
panelObject = new Panel();
labelAddColor = new Label();
labelColor = new Label();
buttonAddWarship = new Button();
buttonCancel = new Button();
groupBoxCreationParameters.SuspendLayout();
groupBoxCreationColors.SuspendLayout();
((System.ComponentModel.ISupportInitialize)numericUpDownWeight).BeginInit();
((System.ComponentModel.ISupportInitialize)numericUpDownSpeed).BeginInit();
((System.ComponentModel.ISupportInitialize)pictureBoxObject).BeginInit();
panelObject.SuspendLayout();
SuspendLayout();
//
// groupBoxCreationParameters
//
groupBoxCreationParameters.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left;
groupBoxCreationParameters.Controls.Add(labelModifiedObject);
groupBoxCreationParameters.Controls.Add(labelSimpleObject);
groupBoxCreationParameters.Controls.Add(groupBoxCreationColors);
groupBoxCreationParameters.Controls.Add(checkBoxCabin);
groupBoxCreationParameters.Controls.Add(checkBoxRunway);
groupBoxCreationParameters.Controls.Add(numericUpDownWeight);
groupBoxCreationParameters.Controls.Add(labelSpeed);
groupBoxCreationParameters.Controls.Add(numericUpDownSpeed);
groupBoxCreationParameters.Controls.Add(labelWeight);
groupBoxCreationParameters.Location = new Point(12, 12);
groupBoxCreationParameters.Name = "groupBoxCreationParameters";
groupBoxCreationParameters.Size = new Size(684, 306);
groupBoxCreationParameters.TabIndex = 0;
groupBoxCreationParameters.TabStop = false;
groupBoxCreationParameters.Text = "Parameters";
//
// labelModifiedObject
//
labelModifiedObject.BorderStyle = BorderStyle.FixedSingle;
labelModifiedObject.Location = new Point(518, 229);
labelModifiedObject.Name = "labelModifiedObject";
labelModifiedObject.Size = new Size(140, 50);
labelModifiedObject.TabIndex = 8;
labelModifiedObject.Text = "Modified";
labelModifiedObject.TextAlign = ContentAlignment.MiddleCenter;
labelModifiedObject.MouseDown += LabelObject_MouseDown;
//
// labelSimpleObject
//
labelSimpleObject.BorderStyle = BorderStyle.FixedSingle;
labelSimpleObject.Location = new Point(358, 229);
labelSimpleObject.Name = "labelSimpleObject";
labelSimpleObject.Size = new Size(140, 50);
labelSimpleObject.TabIndex = 7;
labelSimpleObject.Text = "Simple";
labelSimpleObject.TextAlign = ContentAlignment.MiddleCenter;
labelSimpleObject.MouseDown += LabelObject_MouseDown;
//
// groupBoxCreationColors
//
groupBoxCreationColors.Controls.Add(panelBlack);
groupBoxCreationColors.Controls.Add(panelWhite);
groupBoxCreationColors.Controls.Add(panelPurple);
groupBoxCreationColors.Controls.Add(panelBlue);
groupBoxCreationColors.Controls.Add(panelGreen);
groupBoxCreationColors.Controls.Add(panelRed);
groupBoxCreationColors.Controls.Add(panelGray);
groupBoxCreationColors.Controls.Add(panelYellow);
groupBoxCreationColors.Location = new Point(346, 24);
groupBoxCreationColors.Name = "groupBoxCreationColors";
groupBoxCreationColors.Size = new Size(327, 190);
groupBoxCreationColors.TabIndex = 1;
groupBoxCreationColors.TabStop = false;
groupBoxCreationColors.Text = "Colors";
//
// panelBlack
//
panelBlack.BackColor = Color.Black;
panelBlack.Location = new Point(172, 110);
panelBlack.Name = "panelBlack";
panelBlack.Size = new Size(60, 60);
panelBlack.TabIndex = 7;
panelBlack.MouseDown += PanelColor_MouseDown;
//
// panelWhite
//
panelWhite.BackColor = Color.White;
panelWhite.Location = new Point(12, 110);
panelWhite.Name = "panelWhite";
panelWhite.Size = new Size(60, 60);
panelWhite.TabIndex = 6;
panelWhite.MouseDown += PanelColor_MouseDown;
//
// panelPurple
//
panelPurple.BackColor = Color.Purple;
panelPurple.Location = new Point(252, 110);
panelPurple.Name = "panelPurple";
panelPurple.Size = new Size(60, 60);
panelPurple.TabIndex = 5;
panelPurple.MouseDown += PanelColor_MouseDown;
//
// panelBlue
//
panelBlue.BackColor = Color.Blue;
panelBlue.Location = new Point(172, 30);
panelBlue.Name = "panelBlue";
panelBlue.Size = new Size(60, 60);
panelBlue.TabIndex = 4;
panelBlue.MouseDown += PanelColor_MouseDown;
//
// panelGreen
//
panelGreen.BackColor = Color.Green;
panelGreen.Location = new Point(92, 30);
panelGreen.Name = "panelGreen";
panelGreen.Size = new Size(60, 60);
panelGreen.TabIndex = 3;
panelGreen.MouseDown += PanelColor_MouseDown;
//
// panelRed
//
panelRed.BackColor = Color.Red;
panelRed.Location = new Point(12, 30);
panelRed.Name = "panelRed";
panelRed.Size = new Size(60, 60);
panelRed.TabIndex = 2;
panelRed.MouseDown += PanelColor_MouseDown;
//
// panelGray
//
panelGray.BackColor = Color.Gray;
panelGray.Location = new Point(92, 110);
panelGray.Name = "panelGray";
panelGray.Size = new Size(60, 60);
panelGray.TabIndex = 1;
panelGray.MouseDown += PanelColor_MouseDown;
//
// panelYellow
//
panelYellow.BackColor = Color.Yellow;
panelYellow.Location = new Point(252, 30);
panelYellow.Name = "panelYellow";
panelYellow.Size = new Size(60, 60);
panelYellow.TabIndex = 0;
panelYellow.MouseDown += PanelColor_MouseDown;
//
// checkBoxCabin
//
checkBoxCabin.AutoSize = true;
checkBoxCabin.Location = new Point(25, 198);
checkBoxCabin.Name = "checkBoxCabin";
checkBoxCabin.Size = new Size(272, 29);
checkBoxCabin.TabIndex = 6;
checkBoxCabin.Text = "Indication of cabin availability";
checkBoxCabin.UseVisualStyleBackColor = true;
//
// checkBoxRunway
//
checkBoxRunway.AutoSize = true;
checkBoxRunway.Location = new Point(25, 145);
checkBoxRunway.Name = "checkBoxRunway";
checkBoxRunway.Size = new Size(287, 29);
checkBoxRunway.TabIndex = 5;
checkBoxRunway.Text = "Indication of runway availability";
checkBoxRunway.UseVisualStyleBackColor = true;
//
// numericUpDownWeight
//
numericUpDownWeight.Location = new Point(116, 85);
numericUpDownWeight.Maximum = new decimal(new int[] { 1000, 0, 0, 0 });
numericUpDownWeight.Minimum = new decimal(new int[] { 100, 0, 0, 0 });
numericUpDownWeight.Name = "numericUpDownWeight";
numericUpDownWeight.Size = new Size(180, 31);
numericUpDownWeight.TabIndex = 4;
numericUpDownWeight.Value = new decimal(new int[] { 100, 0, 0, 0 });
//
// labelSpeed
//
labelSpeed.AutoSize = true;
labelSpeed.Location = new Point(16, 43);
labelSpeed.Name = "labelSpeed";
labelSpeed.Size = new Size(66, 25);
labelSpeed.TabIndex = 1;
labelSpeed.Text = "Speed:";
//
// numericUpDownSpeed
//
numericUpDownSpeed.Location = new Point(116, 41);
numericUpDownSpeed.Maximum = new decimal(new int[] { 1000, 0, 0, 0 });
numericUpDownSpeed.Minimum = new decimal(new int[] { 100, 0, 0, 0 });
numericUpDownSpeed.Name = "numericUpDownSpeed";
numericUpDownSpeed.Size = new Size(180, 31);
numericUpDownSpeed.TabIndex = 3;
numericUpDownSpeed.Value = new decimal(new int[] { 100, 0, 0, 0 });
//
// labelWeight
//
labelWeight.AutoSize = true;
labelWeight.Location = new Point(17, 87);
labelWeight.Name = "labelWeight";
labelWeight.Size = new Size(72, 25);
labelWeight.TabIndex = 2;
labelWeight.Text = "Weight:";
//
// pictureBoxObject
//
pictureBoxObject.Location = new Point(16, 70);
pictureBoxObject.Name = "pictureBoxObject";
pictureBoxObject.Size = new Size(331, 157);
pictureBoxObject.TabIndex = 1;
pictureBoxObject.TabStop = false;
//
// panelObject
//
panelObject.AllowDrop = true;
panelObject.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Right;
panelObject.Controls.Add(labelAddColor);
panelObject.Controls.Add(labelColor);
panelObject.Controls.Add(pictureBoxObject);
panelObject.Location = new Point(708, 12);
panelObject.Name = "panelObject";
panelObject.Size = new Size(366, 242);
panelObject.TabIndex = 2;
panelObject.DragDrop += PanelObject_DragDrop;
panelObject.DragEnter += PanelObject_DragEnter;
//
// labelAddColor
//
labelAddColor.AllowDrop = true;
labelAddColor.Anchor = AnchorStyles.Top | AnchorStyles.Right;
labelAddColor.BorderStyle = BorderStyle.FixedSingle;
labelAddColor.Location = new Point(195, 13);
labelAddColor.Name = "labelAddColor";
labelAddColor.Size = new Size(152, 50);
labelAddColor.TabIndex = 3;
labelAddColor.Text = "Add. color";
labelAddColor.TextAlign = ContentAlignment.MiddleCenter;
labelAddColor.DragDrop += LabelAddColor_DragDrop;
labelAddColor.DragEnter += LabelColor_DragEnter;
//
// labelColor
//
labelColor.AllowDrop = true;
labelColor.Anchor = AnchorStyles.Top | AnchorStyles.Right;
labelColor.BorderStyle = BorderStyle.FixedSingle;
labelColor.Location = new Point(16, 13);
labelColor.Name = "labelColor";
labelColor.Size = new Size(156, 50);
labelColor.TabIndex = 2;
labelColor.Text = "Color";
labelColor.TextAlign = ContentAlignment.MiddleCenter;
labelColor.DragDrop += LabelColor_DragDrop;
labelColor.DragEnter += LabelColor_DragEnter;
//
// buttonAddWarship
//
buttonAddWarship.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
buttonAddWarship.Location = new Point(724, 260);
buttonAddWarship.Name = "buttonAddWarship";
buttonAddWarship.Size = new Size(156, 50);
buttonAddWarship.TabIndex = 4;
buttonAddWarship.Text = "Add";
buttonAddWarship.UseVisualStyleBackColor = true;
buttonAddWarship.Click += ButtonAdd_Click;
//
// buttonCancel
//
buttonCancel.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
buttonCancel.Location = new Point(903, 260);
buttonCancel.Name = "buttonCancel";
buttonCancel.Size = new Size(152, 50);
buttonCancel.TabIndex = 5;
buttonCancel.Text = "Cancel";
buttonCancel.UseVisualStyleBackColor = true;
//
// FormWarshipConfig
//
AutoScaleDimensions = new SizeF(10F, 25F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(1084, 322);
Controls.Add(buttonCancel);
Controls.Add(panelObject);
Controls.Add(buttonAddWarship);
Controls.Add(groupBoxCreationParameters);
Name = "FormWarshipConfig";
Text = "Object creation";
groupBoxCreationParameters.ResumeLayout(false);
groupBoxCreationParameters.PerformLayout();
groupBoxCreationColors.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)numericUpDownWeight).EndInit();
((System.ComponentModel.ISupportInitialize)numericUpDownSpeed).EndInit();
((System.ComponentModel.ISupportInitialize)pictureBoxObject).EndInit();
panelObject.ResumeLayout(false);
ResumeLayout(false);
}
#endregion
private GroupBox groupBoxCreationParameters;
private Label labelSpeed;
private Label labelWeight;
private NumericUpDown numericUpDownSpeed;
private NumericUpDown numericUpDownWeight;
private GroupBox groupBoxCreationColors;
private CheckBox checkBoxCabin;
private CheckBox checkBoxRunway;
private Panel panelBlack;
private Panel panelWhite;
private Panel panelPurple;
private Panel panelBlue;
private Panel panelGreen;
private Panel panelRed;
private Panel panelGray;
private Panel panelYellow;
private Label labelModifiedObject;
private Label labelSimpleObject;
private PictureBox pictureBoxObject;
private Panel panelObject;
private Button buttonAddWarship;
private Label labelAddColor;
private Label labelColor;
private Button buttonCancel;
}
}

View File

@ -0,0 +1,153 @@
using ProjectAircraftCarrier.DrawingObjects;
using ProjectAircraftCarrier.Entities;
namespace ProjectAircraftCarrier
{
public partial class FormWarshipConfig : Form
{
/// <summary>
/// Переменная-выбранный военный корабль
/// </summary>
DrawingWarship? _warship = null;
private event Action<DrawingWarship>? EventAddWarship;
/// <summary>
/// Конструктор
/// </summary>
public FormWarshipConfig()
{
InitializeComponent();
panelBlack.MouseDown += PanelColor_MouseDown;
panelPurple.MouseDown += PanelColor_MouseDown;
panelGray.MouseDown += PanelColor_MouseDown;
panelGreen.MouseDown += PanelColor_MouseDown;
panelRed.MouseDown += PanelColor_MouseDown;
panelWhite.MouseDown += PanelColor_MouseDown;
panelYellow.MouseDown += PanelColor_MouseDown;
panelBlue.MouseDown += PanelColor_MouseDown;
buttonCancel.Click += (s, e) => Close();
}
/// <summary>
/// Отрисовать военний корабль
/// </summary>
private void DrawWarship()
{
Bitmap bmp = new(pictureBoxObject.Width, pictureBoxObject.Height);
Graphics gr = Graphics.FromImage(bmp);
_warship?.SetPosition(5, 5);
_warship?.DrawTransport(gr);
pictureBoxObject.Image = bmp;
}
/// <summary>
/// Добавление события
/// </summary>
/// <param name="ev">Привязанный метод</param>
public void AddEvent(Action<DrawingWarship>? ev)
{
if (EventAddWarship == null)
{
EventAddWarship = ev;
}
else
{
EventAddWarship += ev;
}
}
/// <summary>
/// Передаем информацию при нажатии на Label
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void LabelObject_MouseDown(object sender, MouseEventArgs e)
{
(sender as Label)?.DoDragDrop((sender as Label)?.Name,
DragDropEffects.Move | DragDropEffects.Copy);
}
/// <summary>
/// Проверка получаемой информации (ее типа на соответствие требуемому)
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void PanelObject_DragEnter(object sender, DragEventArgs e)
{
if (e.Data?.GetDataPresent(DataFormats.Text) ?? false)
{
e.Effect = DragDropEffects.Copy;
}
else
{
e.Effect = DragDropEffects.None;
}
}
/// <summary>
/// Действия при приеме перетаскиваемой информации
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void PanelObject_DragDrop(object sender, DragEventArgs e)
{
switch (e.Data?.GetData(DataFormats.Text).ToString())
{
case "labelSimpleObject":
_warship = new DrawingWarship(
(int)numericUpDownSpeed.Value,
(int)numericUpDownWeight.Value, Color.White,
pictureBoxObject.Width, pictureBoxObject.Height);
break;
case "labelModifiedObject":
_warship = new DrawingAircraftCarrier(
(int)numericUpDownSpeed.Value,
(int)numericUpDownWeight.Value, Color.White,
Color.Black, checkBoxCabin.Checked,
checkBoxRunway.Checked,
pictureBoxObject.Width,pictureBoxObject.Height);
break;
}
DrawWarship();
}
private void PanelColor_MouseDown(object? sender, MouseEventArgs e)
{
(sender as Panel)?.DoDragDrop((sender as Panel)?.BackColor,
DragDropEffects.Move | DragDropEffects.Copy);
}
/// <summary>
/// Добавление военного корабля
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ButtonAdd_Click(object sender, EventArgs e)
{
if (_warship == null)
return;
EventAddWarship?.Invoke(_warship);
Close();
}
private void LabelColor_DragDrop(object sender, DragEventArgs e)
{
if (_warship?.EntityWarship == null)
return;
Color bodyColor = (Color)e.Data.GetData(typeof(Color));
_warship.EntityWarship.ChangeColor(bodyColor);
DrawWarship();
}
private void LabelAddColor_DragDrop(object sender, DragEventArgs e)
{
if ((_warship?.EntityWarship == null) || (_warship is
DrawingAircraftCarrier == false))
return;
Color additionalColor = (Color)e.Data.GetData(typeof(Color));
((EntityAircraftCarrier)_warship.EntityWarship).ChangeAddColor(additionalColor);
DrawWarship();
}
private void LabelColor_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(typeof(Color)))
{
e.Effect = DragDropEffects.Copy;
}
else
{
e.Effect = DragDropEffects.None;
}
}
}
}

View File

@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ProjectAircraftCarrier.DrawingObjects;
namespace ProjectAircraftCarrier.MovementStrategy
{
/// <summary>
/// Интерфейс для работы с перемещаемым объектом
/// </summary>
public interface IMoveableObject
{
/// <summary>
/// Получение координаты X объекта
/// </summary>
ObjectParameters? GetObjectPosition { get; }
/// <summary>
/// Шаг объекта
/// </summary>
int GetStep { get; }
/// <summary>
/// Проверка, можно ли переместиться по нужному направлению
/// </summary>
/// <param name="direction"></param>
/// <returns></returns>
bool CheckCanMove(DirectionType direction);
/// <summary>
/// Изменение направления пермещения объекта
/// </summary>
/// <param name="direction">Направление</param>
void MoveObject(DirectionType direction);
}
}

View File

@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjectAircraftCarrier.MovementStrategy
{
/// <summary>
/// Стратегия перемещения объекта в центр экрана
/// </summary>
public class MoveToBorder : AbstractStrategy
{
protected override bool IsTargetDestinaion()
{
var objParams = GetObjectParameters;
if (objParams == null)
{
return false;
}
return objParams.RightBorder + GetStep() >= FieldWidth &&
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())
{
MoveRight();
}
var diffY = objParams.DownBorder - FieldHeight;
if (Math.Abs(diffY) > GetStep())
{
MoveDown();
}
}
}
}

View File

@ -0,0 +1,59 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjectAircraftCarrier.MovementStrategy
{
/// <summary>
/// Стратегия перемещения объекта в центр экрана
/// </summary>
public class MoveToCenter : AbstractStrategy
{
protected override bool IsTargetDestinaion()
{
var objParams = GetObjectParameters;
if (objParams == null)
{
return false;
}
return objParams.ObjectMiddleHorizontal <= FieldWidth / 2 &&
objParams.ObjectMiddleHorizontal + GetStep() >= FieldWidth / 2 &&
objParams.ObjectMiddleVertical <= FieldHeight / 2 &&
objParams.ObjectMiddleVertical + GetStep() >= FieldHeight / 2;
}
protected override void MoveToTarget()
{
var objParams = GetObjectParameters;
if (objParams == null)
{
return;
}
var diffX = objParams.ObjectMiddleHorizontal - FieldWidth / 2;
if (Math.Abs(diffX) > GetStep())
{
if (diffX > 0)
{
MoveLeft();
}
else
{
MoveRight();
}
}
var diffY = objParams.ObjectMiddleVertical - FieldHeight / 2;
if (Math.Abs(diffY) > GetStep())
{
if (diffY > 0)
{
MoveUp();
}
else
{
MoveDown();
}
}
}
}
}

View File

@ -0,0 +1,57 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjectAircraftCarrier.MovementStrategy
{
/// <summary>
/// Параметры-координаты объекта
/// </summary>
public class ObjectParameters
{
private readonly int _x;
private readonly int _y;
private readonly int _width;
private readonly int _height;
/// <summary>
/// Левая граница
/// </summary>
public int LeftBorder => _x;
/// <summary>
/// Верхняя граница
/// </summary>
public int TopBorder => _y;
/// <summary>
/// Правая граница
/// </summary>
public int RightBorder => _x + _width;
/// <summary>
/// Нижняя граница
/// </summary>
public int DownBorder => _y + _height;
/// <summary>
/// Середина объекта
/// </summary>
public int ObjectMiddleHorizontal => _x + _width / 2;
/// <summary>
/// Середина объекта
/// </summary>
public int ObjectMiddleVertical => _y + _height / 2;
/// <summary>
/// Конструктор
/// </summary>
/// <param name="x">Координата X</param>
/// <param name="y">Координата Y</param>
/// <param name="width">Ширина</param>
/// <param name="height">Высота</param>
public ObjectParameters(int x, int y, int width, int height)
{
_x = x;
_y = y;
_width = width;
_height = height;
}
}
}

View File

@ -1,4 +1,4 @@
namespace AircraftCarrier
namespace ProjectAircraftCarrier
{
internal static class Program
{
@ -11,7 +11,7 @@ namespace AircraftCarrier
// 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 FormWarshipCollection());
}
}
}

View File

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

View File

@ -0,0 +1,133 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="left" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\left.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="down" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="up" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\up.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="right" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\right.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@ -0,0 +1,105 @@
using System.Numerics;
namespace ProjectAircraftCarrier.Generics
{
/// <summary>
/// Параметризованный набор объектов
/// </summary>
/// <typeparam name="T"></typeparam>
internal class SetGeneric<T>
where T : class
{
/// <summary>
/// Массив объектов, которые храним
/// </summary>
private readonly List<T?> _places;
/// <summary>
/// Количество объектов в массиве
/// </summary>
public int Count => _places.Count;
/// <summary>
/// Максимальное количество объектов в списке
/// </summary>
private readonly int _maxCount;
/// <summary>
/// Конструктор
/// </summary>
/// <param name="count"></param>
public SetGeneric(int count)
{
_maxCount = count;
_places = new List<T?>(count);
}
/// <summary>
/// Добавление объекта в набор
/// </summary>
/// <param name="warship">Добавляемый автомобиль</param>
/// <returns></returns>
public bool Insert(T warship)
{
if (_places.Count == _maxCount)
return false;
Insert(warship, 0);
return true;
}
/// <summary>
/// Добавление объекта в набор на конкретную позицию
/// </summary>
/// <param name="warship">Добавляемый автомобиль</param>
/// <param name="position">Позиция</param>
/// <returns></returns>
public bool Insert(T warship, int position)
{
if (!(position >= 0 && position <= Count && _places.Count <
_maxCount))
return false;
_places.Insert(position, warship);
return true;
}
/// <summary>
/// Удаление объекта из набора с конкретной позиции
/// </summary>
/// <param name="position"></param>
/// <returns></returns>
public bool Remove(int position)
{
if (!(position >= 0 && position < Count))
return false;
_places.RemoveAt(position);
return true;
}
/// <summary>
/// Получение объекта из набора по позиции
/// </summary>
/// <param name="position"></param>
/// <returns></returns>
public T? this[int position]
{
get
{
if (!(position >= 0 && position <= Count))
return null;
return _places[position];
}
set
{
if (!(position >= 0 && position <= Count))
return;
_places.Insert(position, value);
}
}
/// <summary>
/// Проход по списку
/// </summary>
/// <returns></returns>
public IEnumerable<T?> GetWarships(int? maxWarships = null)
{
for (int i = 0; i < _places.Count; ++i)
{
yield return _places[i];
if (maxWarships.HasValue && i == maxWarships.Value)
yield break;
}
}
}
}

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjectAircraftCarrier.MovementStrategy
{
/// <summary>
/// Статус выполнения операции перемещения
/// </summary>
public enum Status
{
NotInit,
InProgress,
Finish
}
}

View File

@ -0,0 +1,142 @@
using ProjectAircraftCarrier.DrawingObjects;
using ProjectAircraftCarrier.MovementStrategy;
namespace ProjectAircraftCarrier.Generics
{
/// <summary>
/// Параметризованный класс для набора объектов DrawningCar
/// </summary>
/// <typeparam name="T"></typeparam>
/// <typeparam name="U"></typeparam>
internal class WarshipsGenericCollection<T, U>
where T : DrawingWarship
where U : IMoveableObject
{
/// <summary>
/// Ширина окна прорисовки
/// </summary>
private readonly int _pictureWidth;
/// <summary>
/// Высота окна прорисовки
/// </summary>
private readonly int _pictureHeight;
/// <summary>
/// Размер занимаемого объектом места (ширина)
/// </summary>
private readonly int _placeSizeWidth = 196;
/// <summary>
/// Размер занимаемого объектом места (высота)
/// </summary>
private readonly int _placeSizeHeight = 58;
/// <summary>
/// Набор объектов
/// </summary>
private readonly SetGeneric<T> _collection;
/// <summary>
/// Конструктор
/// </summary>
/// <param name="picWidth"></param>
/// <param name="picHeight"></param>
public WarshipsGenericCollection(int picWidth, int picHeight)
{
int width = picWidth / _placeSizeWidth;
int height = picHeight / _placeSizeHeight;
_pictureWidth = picWidth;
_pictureHeight = picHeight;
_collection = new SetGeneric<T>(width * height);
}
/// <summary>
/// Перегрузка оператора сложения
/// </summary>
/// <param name="collect"></param>
/// <param name="obj"></param>
/// <returns></returns>
public static bool operator +(WarshipsGenericCollection<T, U>?
collect, T? obj)
{
if (obj == null || collect == null)
return false;
return collect._collection.Insert(obj);
}
/// <summary>
/// Перегрузка оператора вычитания
/// </summary>
/// <param name="collect"></param>
/// <param name="pos"></param>
/// <returns></returns>
public static T? operator -(WarshipsGenericCollection<T, U>
collect, int pos)
{
T? obj = collect._collection[pos];
if (obj != null)
{
collect._collection.Remove(pos);
}
return obj;
}
/// <summary>
/// Получение объекта IMoveableObject
/// </summary>
/// <param name="pos"></param>
/// <returns></returns>
public U? GetU(int pos)
{
return (U?)_collection[pos]?.GetMoveableObject;
}
/// <summary>
/// Вывод всего набора объектов
/// </summary>
/// <returns></returns>
public Bitmap ShowWarships()
{
Bitmap bmp = new(_pictureWidth, _pictureHeight);
Graphics gr = Graphics.FromImage(bmp);
DrawBackground(gr);
DrawObjects(gr);
return bmp;
}
/// <summary>
/// Получение объектов коллекции
/// </summary>
public IEnumerable<T?> GetWarships => _collection.GetWarships();
/// <summary>
/// Метод отрисовки фона
/// </summary>
/// <param name="g"></param>
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);
}
}
/// <summary>
/// Метод прорисовки объектов
/// </summary>
/// <param name="g"></param>
private void DrawObjects(Graphics g)
{
int i = 0;
foreach (var warship in _collection.GetWarships())
{
if (warship != null)
{
int inRow = _pictureWidth / _placeSizeWidth;
warship.SetPosition(i % inRow * _placeSizeWidth,
_pictureHeight - _pictureHeight % _placeSizeHeight
- (i / inRow + 1) * _placeSizeHeight);
warship.DrawTransport(g);
}
i++;
}
}
}
}

View File

@ -0,0 +1,193 @@
using ProjectAircraftCarrier.DrawingObjects;
using ProjectAircraftCarrier.MovementStrategy;
using System.Text;
namespace ProjectAircraftCarrier.Generics
{
/// <summary>
/// Класс для хранения коллекции
/// </summary>
internal class WarshipsGenericStorage
{
/// <summary>
/// Словарь (хранилище)
/// </summary>
readonly Dictionary<string, WarshipsGenericCollection<DrawingWarship,
DrawingObjectWarship>> _warshipStorages;
/// <summary>
/// Возвращение списка названий наборов
/// </summary>
public List<string> Keys => _warshipStorages.Keys.ToList();
/// <summary>
/// Ширина окна отрисовки
/// </summary>
private readonly int _pictureWidth;
/// <summary>
/// Высота окна отрисовки
/// </summary>
private readonly int _pictureHeight;
/// <summary>
/// Разделитель для записи ключа и значения элемента словаря
/// </summary>
private static readonly char _separatorForKeyValue = '|';
/// <summary>
/// Разделитель для записей коллекции данных в файл
/// </summary>
private readonly char _separatorRecords = ';';
/// <summary>
/// Разделитель для записи информации по объекту в файл
/// </summary>
private static readonly char _separatorForObject = ':';
/// <summary>
/// Конструктор
/// </summary>
/// <param name="pictureWidth"></param>
/// <param name="pictureHeight"></param>
public WarshipsGenericStorage(int pictureWidth, int pictureHeight)
{
_warshipStorages = new Dictionary<string,
WarshipsGenericCollection<DrawingWarship,
DrawingObjectWarship>>();
_pictureWidth = pictureWidth;
_pictureHeight = pictureHeight;
}
/// <summary>
/// Добавление набора
/// </summary>
/// <param name="name">Название набора</param>
public void AddSet(string name)
{
if (!_warshipStorages.ContainsKey(name))
{
_warshipStorages.Add(name, new WarshipsGenericCollection
<DrawingWarship, DrawingObjectWarship>(_pictureWidth,
_pictureHeight));
}
else
{
MessageBox.Show("This set already exists");
}
}
/// <summary>
/// Удаление набора
/// </summary>
/// <param name="name">Название набора</param>
public void DelSet(string name)
{
if (!_warshipStorages.ContainsKey(name))
return;
_warshipStorages.Remove(name);
}
/// <summary>
/// Доступ к набору
/// </summary>
/// <param name="ind"></param>
/// <returns></returns>
public WarshipsGenericCollection<DrawingWarship, DrawingObjectWarship>
?this[string ind]
{
get
{
if (_warshipStorages.ContainsKey(ind))
return _warshipStorages[ind];
return null;
}
}
/// <summary>
/// Сохранение информации по кораблям в хранилище в файл
/// </summary>
/// <param name="filename">Путь и имя файла</param>
/// <returns>true - сохранение прошло успешно, false - ошибка при сохранении данных</returns>
public bool SaveData(string filename)
{
if (File.Exists(filename))
{
File.Delete(filename);
}
StringBuilder data = new();
foreach (KeyValuePair<string, WarshipsGenericCollection
<DrawingWarship, DrawingObjectWarship>> record in
_warshipStorages)
{
StringBuilder records = new();
foreach (DrawingWarship? elem in record.Value.GetWarships)
{
records.Append($"" +
$"{elem?.GetDataForSave(_separatorForObject)}" +
$"{_separatorRecords}");
}
data.AppendLine($"{record.Key}{_separatorForKeyValue}" +
$"{records}");
}
if (data.Length == 0)
{
return false;
}
using FileStream fs = new(filename, FileMode.Create);
byte[] info = new UTF8Encoding(true).GetBytes($"WarshipStorage" +
$"{Environment.NewLine}{data}");
fs.Write(info, 0, info.Length);
return true;
}
/// <summary>
/// Загрузка информации по кораблям в хранилище из файла
/// </summary>
/// <param name="filename">Путь и имя файла</param>
/// <returns>true - загрузка прошла успешно, false - ошибка при загрузке данных</returns>
public bool LoadData(string filename)
{
if (!File.Exists(filename))
{
return false;
}
string bufferTextFromFile = "";
using (FileStream fs = new(filename, FileMode.Open))
{
byte[] b = new byte[fs.Length];
UTF8Encoding temp = new(true);
while (fs.Read(b, 0, b.Length) > 0)
{
bufferTextFromFile += temp.GetString(b);
}
}
var strs = bufferTextFromFile.Split(new char[] { '\n', '\r' },
StringSplitOptions.RemoveEmptyEntries);
if (strs == null || strs.Length == 0)
{
return false;
}
if (!strs[0].StartsWith("WarshipStorage"))
{
return false;
}
_warshipStorages.Clear();
foreach (string data in strs)
{
string[] record = data.Split(_separatorForKeyValue,
StringSplitOptions.RemoveEmptyEntries);
if (record.Length != 2)
{
continue;
}
WarshipsGenericCollection<DrawingWarship, DrawingObjectWarship>
collection = new(_pictureWidth, _pictureHeight);
string[] set = record[1].Split(_separatorRecords,
StringSplitOptions.RemoveEmptyEntries);
foreach (string elem in set)
{
DrawingWarship? warship =
elem?.CreateDrawingWarship(_separatorForObject,
_pictureWidth, _pictureHeight);
if (warship != null)
{
if (!(collection + warship))
{
return false;
}
}
}
_warshipStorages.Add(record[0], collection);
}
return true;
}
}
}