Compare commits

...

6 Commits

Author SHA1 Message Date
Sharosh322
6f933314ab Done 2023-12-23 10:48:19 +04:00
Sharosh322
0e2ce08130 Done 2023-12-09 22:36:48 +04:00
Sharosh322
c5f197893f Done 2023-12-09 22:27:17 +04:00
Sharosh322
468abaf5f8 Done+ 2023-12-09 22:11:25 +04:00
Sharosh322
e464cbb14e Done 2023-12-09 22:09:33 +04:00
Sharosh322
9632e3e1d0 Done 2023-12-09 21:56:41 +04:00
29 changed files with 3310 additions and 0 deletions

View File

@ -0,0 +1,132 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjStormtrooper
{
/// <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(Direction.Left);
/// <summary>
/// Перемещение вправо
/// </summary>
/// <returns>Результат перемещения (true - удалось переместиться, false - неудача)</returns>
protected bool MoveRight() => MoveTo(Direction.Right);
/// <summary>
/// Перемещение вверх
/// </summary>
/// <returns>Результат перемещения (true - удалось переместиться, false - неудача)</returns>
protected bool MoveUp() => MoveTo(Direction.Up);
/// <summary>
/// Перемещение вниз
/// </summary>
/// <returns>Результат перемещения (true - удалось переместиться, false - неудача)</returns>
protected bool MoveDown() => MoveTo(Direction.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(Direction directionType)
{
if (_state != Status.InProgress)
{
return false;
}
if (_moveableObject?.CheckCanMove(directionType) ?? false)
{
_moveableObject.MoveObject(directionType);
return true;
}
return false;
}
}
}

View File

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

View File

@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjStormtrooper
{
/// <summary>
/// Реализация интерфейса IDrawningObject для работы с объектом DrawningPlane (паттерн Adapter)
/// </summary>
public class DrawingObjectPlane : IMoveableObject
{
private readonly DrawingPlane? _drawingPlane = null;
public DrawingObjectPlane(DrawingPlane drawingPlane)
{
_drawingPlane = drawingPlane;
}
public ObjectParameters? GetObjectPosition
{
get
{
if (_drawingPlane == null || _drawingPlane.EntityPlane == null)
{
return null;
}
return new ObjectParameters(_drawingPlane.GetPosX, _drawingPlane.GetPosY, _drawingPlane.GetWidth, _drawingPlane.GetHeight);
}
}
public int GetStep => (int)(_drawingPlane?.EntityPlane?.Step ?? 0);
public bool CheckCanMove(Direction direction) => _drawingPlane?.CanMove(direction) ?? false;
public void MoveObject(Direction direction) => _drawingPlane?.MoveTransport(direction);
}
}

View File

@ -0,0 +1,243 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjStormtrooper
{
/// <summary>
/// Класс отвечающий за прорисовку и перемещение объекта-сущности
/// </summary>
public class DrawingPlane
{
/// <summary>
/// Класс-сущность
/// </summary>
public EntityPlane? EntityPlane { get; protected set; }
/// <summary>
/// Ширина окна
/// </summary>
public int _pictureWidth;
/// <summary>
/// Высота окна
/// </summary>
public int _pictureHeight;
/// <summary>
/// Левая координата начала прорисовки
/// </summary>
protected int _startPosX;
/// <summary>
/// Верхняя координата начала прорисовки
/// </summary>
protected int _startPosY;
/// <summary>
/// Ширина прорисовки
/// </summary>
protected readonly int _planeWidth = 110;
/// <summary>
/// Высота прорисовки
/// </summary>
protected readonly int _planeHeight = 110;
/// <summary>
/// Координата X объекта
/// </summary>
public int GetPosX => _startPosX;
/// <summary>
/// Координата Y объекта
/// </summary>
public int GetPosY => _startPosY;
/// <summary>
/// Ширина объекта
/// </summary>
public int GetWidth => _planeWidth;
/// <summary>
/// Высота объекта
/// </summary>
public int GetHeight => _planeHeight;
/// <summary>
/// Конструктор
/// </summary>
/// <param name="speed">Скорость</param>
/// <param name="weight">Вес</param>
/// <param name="bodyColor">Основной цвет</param>
/// <param name="width">Ширина картинки</param>
/// <param name="height">Высота картинки</param>
public DrawingPlane(int speed, double weight, Color bodyColor, int width, int height)
{
if (width < _planeWidth && height < _planeHeight)
{
return;
}
_pictureWidth = width;
_pictureHeight = height;
EntityPlane = new EntityPlane(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="planeWidth">Ширина объекта</param>
/// <param name="planeHeight">Высота объекта</param>
protected DrawingPlane(int speed, double weight, Color bodyColor,
int width, int height, int planeWidth, int planeHeight)
{
if (width < planeWidth && height < planeHeight)
{
return;
}
_pictureWidth = width;
_pictureHeight = height;
_planeWidth = planeWidth;
_planeHeight = planeHeight;
EntityPlane = new EntityPlane(speed, weight, bodyColor);
}
/// <summary>
/// Проверка, что объект может переместится по указанному направлению
/// </summary>
/// <param name="direction">Направление</param>
/// <returns>true - можно переместится по указанному направлению</returns>
public bool CanMove(Direction direction)
{
if (EntityPlane == null)
{
return false;
}
return direction switch
{
//вверх
Direction.Up => _startPosY - EntityPlane.Step > 0,
//вниз
Direction.Down => _startPosY + _planeHeight + EntityPlane.Step < _pictureHeight,
//влево
Direction.Left => _startPosX - EntityPlane.Step > 0,
//вправо
Direction.Right => _startPosX + _planeWidth + EntityPlane.Step < _pictureWidth,
_ => false,
};
}
/// <summary>
/// Установка позиции
/// </summary>
/// <param name="x">Координата X</param>
/// <param name="y">Координата Y</param>
public void SetPosition(int x, int y)
{
if (x < 0)
{
x = 0;
}
else if (x > _pictureWidth - _planeWidth)
{
x = _pictureWidth - _planeWidth;
}
_startPosX = x;
if (y < 0)
{
y = 0;
}
else if (y > _pictureHeight - _planeHeight)
{
y = _pictureHeight - _planeHeight;
}
_startPosY = y;
}
/// <summary>
/// Перемещение объекта
/// </summary>
/// <param name="direction">Направление перемещения</param>
public void MoveTransport(Direction direction)
{
if (!CanMove(direction) || EntityPlane == null)
{
return;
}
switch (direction)
{
// Вверх
case Direction.Up:
_startPosY -= (int)EntityPlane.Step;
break;
// Вниз
case Direction.Down:
_startPosY += (int)EntityPlane.Step;
break;
// Влево
case Direction.Left:
_startPosX -= (int)EntityPlane.Step;
break;
// Вправо
case Direction.Right:
_startPosX += (int)EntityPlane.Step;
break;
}
}
/// <summary>
/// Прорисовка объекта
/// </summary>
/// <param name="g"></param>
public virtual void DrawTransport(Graphics g)
{
if (EntityPlane == null)
{
return;
}
Pen penBlack = new Pen(Color.Black);
Brush brushBlack = new SolidBrush(Color.Black);
Brush brushBodyColor = new SolidBrush(EntityPlane.BodyColor);
// Высота фюзеляжа
int bodyHeight = _planeHeight / 9;
// Рисуем нос
Point[] pointsCockPit = {
new Point(_startPosX, _startPosY + _planeHeight / 2),
new Point(_startPosX + _planeWidth / 8, _startPosY + _planeHeight / 2 - bodyHeight / 2),
new Point(_startPosX + _planeWidth / 8, _startPosY + _planeHeight / 2 + bodyHeight / 2)
};
g.FillPolygon(brushBlack, pointsCockPit);
// Рисуем крылья
Point[] pointsWings = {
new Point(_startPosX + _planeWidth / 2, _startPosY),
new Point(_startPosX + _planeWidth / 2 + _planeWidth / 15, _startPosY),
new Point(_startPosX + _planeWidth / 2 + _planeWidth / 6, _startPosY + _planeHeight / 2),
new Point(_startPosX + _planeWidth / 2 + _planeWidth / 15, _startPosY + _planeHeight),
new Point(_startPosX + _planeWidth / 2 , _startPosY + _planeHeight)
};
g.FillPolygon(brushBodyColor, pointsWings);
g.DrawPolygon(penBlack, pointsWings);
// Рисуем хвостовое оперение
Point[] pointsTail = {
new Point(_startPosX + _planeWidth, _startPosY + _planeHeight / 2 - _planeHeight / 3),
new Point(_startPosX + _planeWidth - _planeWidth / 8, _startPosY + _planeHeight / 2 - _planeHeight / 8),
new Point(_startPosX + _planeWidth - _planeWidth / 8, _startPosY + _planeHeight / 2 + _planeHeight / 8),
new Point(_startPosX + _planeWidth, _startPosY + _planeHeight / 2 + _planeHeight / 3)
};
g.FillPolygon(brushBodyColor, pointsTail);
g.DrawPolygon(penBlack, pointsTail);
// Рисуем фюзеляж
g.FillRectangle(brushBodyColor, _startPosX + _planeWidth / 8, _startPosY + _planeHeight / 2 - bodyHeight / 2, _planeWidth - _planeWidth / 8, bodyHeight);
g.DrawRectangle(penBlack, _startPosX + _planeWidth / 8, _startPosY + _planeHeight / 2 - bodyHeight / 2, _planeWidth - _planeWidth / 8, bodyHeight);
}
/// <summary>
/// Получение объекта IMoveableObject из объекта DrawingPlane
/// </summary>
public IMoveableObject GetMoveableObject => new DrawingObjectPlane(this);
}
}

View File

@ -0,0 +1,176 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjStormtrooper
{
public class DrawingStormtrooper : DrawingPlane
{
/// <summary>
/// Конструктор
/// </summary>
/// <param name="speed">Скорость</param>
/// <param name="weight">Вес</param>
/// <param name="bodyColor">Основной цвет</param>
/// <param name="additionalColor">Дополнительный цвет</param>
/// <param name="rockets">Признак наличия ракет</param>
/// <param name="bombs">Признак наличия бомб</param>
/// <param name="width">Ширина картинки</param>
/// <param name="height">Высота картинки</param>
public DrawingStormtrooper(int speed, double weight, Color bodyColor,
Color additionalColor, bool rockets, bool bombs,
int width, int height) : base(speed, weight, bodyColor, width, height, 140, 90)
{
if (EntityPlane != null)
{
EntityPlane = new EntityStormtrooper(speed, weight, bodyColor, additionalColor, rockets, bombs);
}
}
/// <summary>
/// Прорисовка объекта
/// </summary>
/// <param name="g"></param>
public override void DrawTransport(Graphics g)
{
if (EntityPlane is not EntityStormtrooper stormtrooper)
{
return;
}
Pen penBlack = new Pen(Color.Black);
Brush brushBlack = new SolidBrush(Color.Black);
Brush brushAdditionalColor = new SolidBrush(stormtrooper.AdditionalColor);
// Высота фюзеляжа
int bodyHeight = _planeHeight / 9;
// Рисуем бомбы
if (stormtrooper.Bombs)
{
Point[] pointsBombTail = {
new Point(_startPosX + _planeWidth / 2 - _planeWidth / 8 + bodyHeight * 3 - 5,
_startPosY + _planeHeight / 2 - bodyHeight / 2 - _planeHeight / 3 + bodyHeight / 2),
new Point(_startPosX + _planeWidth / 2 - _planeWidth / 8 + bodyHeight * 3 + 5,
_startPosY + _planeHeight / 2 - bodyHeight / 2 - _planeHeight / 3 + bodyHeight / 2 - 5),
new Point(_startPosX + _planeWidth / 2 - _planeWidth / 8 + bodyHeight * 3 + 5,
_startPosY + _planeHeight / 2 - bodyHeight / 2 - _planeHeight / 3 + bodyHeight / 2 + 5),
new Point(_startPosX + _planeWidth / 2 - _planeWidth / 8 + bodyHeight * 3 - 5,
_startPosY + _planeHeight / 2 - bodyHeight / 2 - _planeHeight / 3 + bodyHeight / 2)
};
g.FillPolygon(brushAdditionalColor, pointsBombTail);
g.DrawPolygon(penBlack, pointsBombTail);
for (int i = 0; i < pointsBombTail.Length; i++)
{
Point p = pointsBombTail[i];
p.Y = _startPosY + _planeHeight - (p.Y - _startPosY);
pointsBombTail[i] = p;
}
g.FillPolygon(brushAdditionalColor, pointsBombTail);
g.DrawPolygon(penBlack, pointsBombTail);
g.FillEllipse(brushAdditionalColor,
_startPosX + _planeWidth / 2 - _planeWidth / 8,
_startPosY + _planeHeight / 2 - bodyHeight / 2 - _planeHeight / 3,
bodyHeight * 3,
bodyHeight);
g.DrawEllipse(penBlack,
_startPosX + _planeWidth / 2 - _planeWidth / 8,
_startPosY + _planeHeight / 2 - bodyHeight / 2 - _planeHeight / 3,
bodyHeight * 3,
bodyHeight);
g.FillEllipse(brushAdditionalColor,
_startPosX + _planeWidth / 2 - _planeWidth / 8,
_startPosY + _planeHeight / 2 - bodyHeight / 2 + _planeHeight / 3,
bodyHeight * 3,
bodyHeight);
g.DrawEllipse(penBlack,
_startPosX + _planeWidth / 2 - _planeWidth / 8,
_startPosY + _planeHeight / 2 - bodyHeight / 2 + _planeHeight / 3,
bodyHeight * 3,
bodyHeight);
}
// Рисуем ракеты
if (stormtrooper.Rockets)
{
int rocketWidth = bodyHeight * 4;
int rocketHeight = bodyHeight / 2;
Brush brushRed = new SolidBrush(Color.Red);
Point[] pointsRocketCockPit = {
new Point(_startPosX + _planeWidth / 2 - _planeWidth / 5 - rocketHeight,
_startPosY + _planeHeight / 2 - bodyHeight - bodyHeight / 2 + rocketHeight / 2),
new Point(_startPosX + _planeWidth / 2 - _planeWidth / 5,
_startPosY + _planeHeight / 2 - bodyHeight - bodyHeight / 2),
new Point(_startPosX + _planeWidth / 2 - _planeWidth / 5,
_startPosY + _planeHeight / 2 - bodyHeight - bodyHeight / 2 + rocketHeight)
};
Point[] pointsRocketTail = {
new Point(_startPosX + _planeWidth / 2 - _planeWidth / 5 - rocketHeight + rocketWidth - 10,
_startPosY + _planeHeight / 2 - bodyHeight - bodyHeight / 2 + rocketHeight / 2),
new Point(_startPosX + _planeWidth / 2 - _planeWidth / 5 + rocketWidth,
_startPosY + _planeHeight / 2 - bodyHeight * 2 + rocketHeight / 2),
new Point(_startPosX + _planeWidth / 2 - _planeWidth / 5 + rocketWidth,
_startPosY + _planeHeight / 2 - bodyHeight - bodyHeight / 2 + rocketHeight + bodyHeight / 2 - rocketHeight / 2)
};
g.FillPolygon(brushRed, pointsRocketCockPit);
g.DrawPolygon(penBlack, pointsRocketCockPit);
g.FillPolygon(brushBlack, pointsRocketTail);
g.DrawPolygon(penBlack, pointsRocketTail);
for (int i = 0; i < pointsRocketCockPit.Length; i++)
{
Point p = pointsRocketCockPit[i];
p.Y = _startPosY + _planeHeight - (p.Y - _startPosY);
pointsRocketCockPit[i] = p;
}
for (int i = 0; i < pointsRocketTail.Length; i++)
{
Point p = pointsRocketTail[i];
p.Y = _startPosY + _planeHeight - (p.Y - _startPosY);
pointsRocketTail[i] = p;
}
g.FillPolygon(brushRed, pointsRocketCockPit);
g.DrawPolygon(penBlack, pointsRocketCockPit);
g.FillPolygon(brushBlack, pointsRocketTail);
g.DrawPolygon(penBlack, pointsRocketTail);
g.FillRectangle(brushAdditionalColor,
_startPosX + _planeWidth / 2 - _planeWidth / 5,
_startPosY + _planeHeight / 2 - bodyHeight - bodyHeight / 2,
rocketWidth,
rocketHeight);
g.DrawRectangle(penBlack,
_startPosX + _planeWidth / 2 - _planeWidth / 5,
_startPosY + _planeHeight / 2 - bodyHeight - bodyHeight / 2,
rocketWidth,
rocketHeight);
g.FillRectangle(brushAdditionalColor,
_startPosX + _planeWidth / 2 - _planeWidth / 5,
_startPosY + _planeHeight / 2 + bodyHeight / 2 + bodyHeight / 2,
rocketWidth,
rocketHeight);
g.DrawRectangle(penBlack,
_startPosX + _planeWidth / 2 - _planeWidth / 5,
_startPosY + _planeHeight / 2 + bodyHeight / 2 + bodyHeight / 2,
rocketWidth,
rocketHeight);
}
base.DrawTransport(g);
}
}
}

View File

@ -0,0 +1,49 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
using static System.Reflection.Metadata.BlobBuilder;
namespace ProjStormtrooper
{
/// <summary>
/// Класс-сущность "Самолет"
/// </summary>
public class EntityPlane
{
/// <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 * 250 / Weight;
/// <summary>
/// Конструктор
/// </summary>
/// <param name="speed"></param>
/// <param name="weight"></param>
/// <param name="bodyColor"></param>
public EntityPlane(int speed, double weight, Color bodyColor)
{
Speed = speed;
Weight = weight;
BodyColor = bodyColor;
}
public void SetColor(Color color)
{
BodyColor = color;
}
}
}

View File

@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjStormtrooper
{
public class EntityStormtrooper : EntityPlane
{
public Color AdditionalColor { get; private set; }
/// <summary>
/// Признак (опция) наличия ракет
/// </summary>
public bool Rockets { get; private set; }
/// <summary>
/// Признак (опция) наличия бомб
/// </summary>
public bool Bombs { get; private set; }
public EntityStormtrooper(int speed, double weight, Color bodyColor,
Color additionalColor, bool rockets, bool bombs) : base(speed, weight, bodyColor)
{
AdditionalColor = additionalColor;
Rockets = rockets;
Bombs = bombs;
}
public void SetAdditionalColor(Color color)
{
AdditionalColor = color;
}
}
}

View File

@ -0,0 +1,382 @@
namespace ProjStormtrooper
{
partial class FormPlaneConfig
{
/// <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()
{
groupBoxParams = new GroupBox();
groupBoxColors = new GroupBox();
panelColorPink = new Panel();
panelColorPurple = new Panel();
panelColorBlue = new Panel();
panelColorBrown = new Panel();
panelColorGreen = new Panel();
panelColorLightBlue = new Panel();
panelColorYellow = new Panel();
panelColorRed = new Panel();
labelStormtrooper = new Label();
labelPlane = new Label();
checkBoxRockets = new CheckBox();
checkBoxBombs = new CheckBox();
numericUpDownWeight = new NumericUpDown();
numericUpDownSpeed = new NumericUpDown();
labelWeight = new Label();
labelSpeed = new Label();
buttonCancel = new Button();
buttonApply = new Button();
pictureBoxObject = new PictureBox();
labelAddColor = new Label();
labelColor = new Label();
panelControl = new Panel();
groupBoxParams.SuspendLayout();
groupBoxColors.SuspendLayout();
((System.ComponentModel.ISupportInitialize)numericUpDownWeight).BeginInit();
((System.ComponentModel.ISupportInitialize)numericUpDownSpeed).BeginInit();
((System.ComponentModel.ISupportInitialize)pictureBoxObject).BeginInit();
panelControl.SuspendLayout();
SuspendLayout();
//
// groupBoxParams
//
groupBoxParams.Controls.Add(groupBoxColors);
groupBoxParams.Controls.Add(labelStormtrooper);
groupBoxParams.Controls.Add(labelPlane);
groupBoxParams.Controls.Add(checkBoxRockets);
groupBoxParams.Controls.Add(checkBoxBombs);
groupBoxParams.Controls.Add(numericUpDownWeight);
groupBoxParams.Controls.Add(numericUpDownSpeed);
groupBoxParams.Controls.Add(labelWeight);
groupBoxParams.Controls.Add(labelSpeed);
groupBoxParams.Location = new Point(2, 5);
groupBoxParams.Margin = new Padding(3, 2, 3, 2);
groupBoxParams.Name = "groupBoxParams";
groupBoxParams.Padding = new Padding(3, 2, 3, 2);
groupBoxParams.Size = new Size(435, 196);
groupBoxParams.TabIndex = 0;
groupBoxParams.TabStop = false;
groupBoxParams.Text = "Параметры";
//
// groupBoxColors
//
groupBoxColors.Controls.Add(panelColorPink);
groupBoxColors.Controls.Add(panelColorPurple);
groupBoxColors.Controls.Add(panelColorBlue);
groupBoxColors.Controls.Add(panelColorBrown);
groupBoxColors.Controls.Add(panelColorGreen);
groupBoxColors.Controls.Add(panelColorLightBlue);
groupBoxColors.Controls.Add(panelColorYellow);
groupBoxColors.Controls.Add(panelColorRed);
groupBoxColors.Location = new Point(154, 20);
groupBoxColors.Margin = new Padding(3, 2, 3, 2);
groupBoxColors.Name = "groupBoxColors";
groupBoxColors.Padding = new Padding(3, 2, 3, 2);
groupBoxColors.Size = new Size(270, 117);
groupBoxColors.TabIndex = 8;
groupBoxColors.TabStop = false;
groupBoxColors.Text = "Цвета";
//
// panelColorPink
//
panelColorPink.BackColor = Color.FromArgb(255, 192, 192);
panelColorPink.Location = new Point(211, 67);
panelColorPink.Margin = new Padding(3, 2, 3, 2);
panelColorPink.Name = "panelColorPink";
panelColorPink.Size = new Size(44, 38);
panelColorPink.TabIndex = 1;
//
// panelColorPurple
//
panelColorPurple.BackColor = Color.Fuchsia;
panelColorPurple.Location = new Point(144, 67);
panelColorPurple.Margin = new Padding(3, 2, 3, 2);
panelColorPurple.Name = "panelColorPurple";
panelColorPurple.Size = new Size(44, 38);
panelColorPurple.TabIndex = 1;
//
// panelColorBlue
//
panelColorBlue.BackColor = Color.SlateGray;
panelColorBlue.Location = new Point(76, 67);
panelColorBlue.Margin = new Padding(3, 2, 3, 2);
panelColorBlue.Name = "panelColorBlue";
panelColorBlue.Size = new Size(44, 38);
panelColorBlue.TabIndex = 1;
//
// panelColorBrown
//
panelColorBrown.BackColor = Color.FromArgb(192, 64, 0);
panelColorBrown.Location = new Point(15, 67);
panelColorBrown.Margin = new Padding(3, 2, 3, 2);
panelColorBrown.Name = "panelColorBrown";
panelColorBrown.Size = new Size(44, 38);
panelColorBrown.TabIndex = 3;
//
// panelColorGreen
//
panelColorGreen.BackColor = Color.Lime;
panelColorGreen.Location = new Point(211, 20);
panelColorGreen.Margin = new Padding(3, 2, 3, 2);
panelColorGreen.Name = "panelColorGreen";
panelColorGreen.Size = new Size(44, 38);
panelColorGreen.TabIndex = 1;
//
// panelColorLightBlue
//
panelColorLightBlue.BackColor = Color.FromArgb(64, 0, 64);
panelColorLightBlue.Location = new Point(144, 20);
panelColorLightBlue.Margin = new Padding(3, 2, 3, 2);
panelColorLightBlue.Name = "panelColorLightBlue";
panelColorLightBlue.Size = new Size(44, 38);
panelColorLightBlue.TabIndex = 2;
//
// panelColorYellow
//
panelColorYellow.BackColor = Color.Yellow;
panelColorYellow.Location = new Point(76, 20);
panelColorYellow.Margin = new Padding(3, 2, 3, 2);
panelColorYellow.Name = "panelColorYellow";
panelColorYellow.Size = new Size(44, 38);
panelColorYellow.TabIndex = 1;
panelColorYellow.Paint += panelColorYellow_Paint;
//
// panelColorRed
//
panelColorRed.BackColor = Color.Blue;
panelColorRed.Location = new Point(15, 20);
panelColorRed.Margin = new Padding(3, 2, 3, 2);
panelColorRed.Name = "panelColorRed";
panelColorRed.Size = new Size(44, 38);
panelColorRed.TabIndex = 0;
panelColorRed.Paint += panelColorRed_Paint;
//
// labelStormtrooper
//
labelStormtrooper.BorderStyle = BorderStyle.FixedSingle;
labelStormtrooper.Location = new Point(298, 152);
labelStormtrooper.Name = "labelStormtrooper";
labelStormtrooper.Padding = new Padding(9, 8, 9, 8);
labelStormtrooper.Size = new Size(111, 32);
labelStormtrooper.TabIndex = 7;
labelStormtrooper.Text = "Продвинутый";
labelStormtrooper.TextAlign = ContentAlignment.MiddleCenter;
labelStormtrooper.Click += labelStormtrooper_Click;
labelStormtrooper.MouseDown += labelObject_MouseDown;
//
// labelPlane
//
labelPlane.BorderStyle = BorderStyle.FixedSingle;
labelPlane.Location = new Point(169, 152);
labelPlane.Name = "labelPlane";
labelPlane.Padding = new Padding(9, 8, 9, 8);
labelPlane.Size = new Size(105, 32);
labelPlane.TabIndex = 6;
labelPlane.Text = "Простой";
labelPlane.TextAlign = ContentAlignment.MiddleCenter;
labelPlane.MouseDown += labelObject_MouseDown;
//
// checkBoxRockets
//
checkBoxRockets.AutoSize = true;
checkBoxRockets.Location = new Point(5, 109);
checkBoxRockets.Margin = new Padding(3, 2, 3, 2);
checkBoxRockets.Name = "checkBoxRockets";
checkBoxRockets.Size = new Size(65, 19);
checkBoxRockets.TabIndex = 5;
checkBoxRockets.Text = "Ракеты";
checkBoxRockets.UseVisualStyleBackColor = true;
//
// checkBoxBombs
//
checkBoxBombs.AutoSize = true;
checkBoxBombs.Location = new Point(5, 86);
checkBoxBombs.Margin = new Padding(3, 2, 3, 2);
checkBoxBombs.Name = "checkBoxBombs";
checkBoxBombs.Size = new Size(65, 19);
checkBoxBombs.TabIndex = 4;
checkBoxBombs.Text = "Бомбы";
checkBoxBombs.UseVisualStyleBackColor = true;
//
// numericUpDownWeight
//
numericUpDownWeight.Location = new Point(77, 55);
numericUpDownWeight.Margin = new Padding(3, 2, 3, 2);
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(72, 23);
numericUpDownWeight.TabIndex = 3;
numericUpDownWeight.Value = new decimal(new int[] { 100, 0, 0, 0 });
//
// numericUpDownSpeed
//
numericUpDownSpeed.Location = new Point(77, 22);
numericUpDownSpeed.Margin = new Padding(3, 2, 3, 2);
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(72, 23);
numericUpDownSpeed.TabIndex = 2;
numericUpDownSpeed.Value = new decimal(new int[] { 100, 0, 0, 0 });
//
// labelWeight
//
labelWeight.AutoSize = true;
labelWeight.Location = new Point(5, 56);
labelWeight.Name = "labelWeight";
labelWeight.Size = new Size(29, 15);
labelWeight.TabIndex = 1;
labelWeight.Text = "Вес:";
//
// labelSpeed
//
labelSpeed.AutoSize = true;
labelSpeed.Location = new Point(5, 23);
labelSpeed.Name = "labelSpeed";
labelSpeed.Size = new Size(62, 15);
labelSpeed.TabIndex = 0;
labelSpeed.Text = "Скорость:";
//
// buttonCancel
//
buttonCancel.Location = new Point(156, 165);
buttonCancel.Margin = new Padding(3, 2, 3, 2);
buttonCancel.Name = "buttonCancel";
buttonCancel.Size = new Size(82, 22);
buttonCancel.TabIndex = 4;
buttonCancel.Text = "Отмена";
buttonCancel.UseVisualStyleBackColor = true;
//
// buttonApply
//
buttonApply.Location = new Point(18, 165);
buttonApply.Margin = new Padding(3, 2, 3, 2);
buttonApply.Name = "buttonApply";
buttonApply.Size = new Size(82, 22);
buttonApply.TabIndex = 3;
buttonApply.Text = "Добавить";
buttonApply.UseVisualStyleBackColor = true;
buttonApply.Click += buttonApply_Click;
//
// pictureBoxObject
//
pictureBoxObject.Location = new Point(18, 51);
pictureBoxObject.Margin = new Padding(3, 2, 3, 2);
pictureBoxObject.Name = "pictureBoxObject";
pictureBoxObject.Size = new Size(220, 110);
pictureBoxObject.TabIndex = 2;
pictureBoxObject.TabStop = false;
//
// labelAddColor
//
labelAddColor.AllowDrop = true;
labelAddColor.BorderStyle = BorderStyle.FixedSingle;
labelAddColor.Location = new Point(150, 12);
labelAddColor.Name = "labelAddColor";
labelAddColor.Size = new Size(88, 30);
labelAddColor.TabIndex = 1;
labelAddColor.Text = "Доп. цвет";
labelAddColor.TextAlign = ContentAlignment.MiddleCenter;
labelAddColor.DragDrop += labelAddColor_DragDrop;
labelAddColor.DragEnter += labelColor_DragEnter;
//
// labelColor
//
labelColor.AllowDrop = true;
labelColor.BorderStyle = BorderStyle.FixedSingle;
labelColor.Location = new Point(18, 12);
labelColor.Name = "labelColor";
labelColor.Size = new Size(88, 30);
labelColor.TabIndex = 0;
labelColor.Text = "Цвет";
labelColor.TextAlign = ContentAlignment.MiddleCenter;
labelColor.DragDrop += labelColor_DragDrop;
labelColor.DragEnter += labelColor_DragEnter;
//
// panelControl
//
panelControl.AllowDrop = true;
panelControl.Controls.Add(labelColor);
panelControl.Controls.Add(buttonCancel);
panelControl.Controls.Add(buttonApply);
panelControl.Controls.Add(pictureBoxObject);
panelControl.Controls.Add(labelAddColor);
panelControl.Location = new Point(442, 9);
panelControl.Margin = new Padding(3, 2, 3, 2);
panelControl.Name = "panelControl";
panelControl.Size = new Size(261, 192);
panelControl.TabIndex = 5;
panelControl.DragDrop += panelControlObject_DragDrop;
panelControl.DragEnter += panelControlObject_DragEnter;
//
// FormPlaneConfig
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(708, 206);
Controls.Add(panelControl);
Controls.Add(groupBoxParams);
Margin = new Padding(3, 2, 3, 2);
Name = "FormPlaneConfig";
Text = "Создание объекта";
groupBoxParams.ResumeLayout(false);
groupBoxParams.PerformLayout();
groupBoxColors.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)numericUpDownWeight).EndInit();
((System.ComponentModel.ISupportInitialize)numericUpDownSpeed).EndInit();
((System.ComponentModel.ISupportInitialize)pictureBoxObject).EndInit();
panelControl.ResumeLayout(false);
ResumeLayout(false);
}
#endregion
private GroupBox groupBoxParams;
private GroupBox groupBoxColors;
private Label labelStormtrooper;
private Label labelPlane;
private CheckBox checkBoxRockets;
private CheckBox checkBoxBombs;
private NumericUpDown numericUpDownWeight;
private NumericUpDown numericUpDownSpeed;
private Label labelWeight;
private Label labelSpeed;
private Panel panelColorRed;
private Panel panelColorPink;
private Panel panelColorPurple;
private Panel panelColorBlue;
private Panel panelColorBrown;
private Panel panelColorGreen;
private Panel panelColorLightBlue;
private Panel panelColorYellow;
private Button buttonCancel;
private Button buttonApply;
private PictureBox pictureBoxObject;
private Label labelAddColor;
private Label labelColor;
private Panel panelControl;
}
}

View File

@ -0,0 +1,127 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ProjStormtrooper
{
public partial class FormPlaneConfig : Form
{
/// <summary>
/// Переменная-выбранный самолет
/// </summary>
DrawingPlane? _plane = null;
/// <summary>
/// Событие
/// </summary>
private event Action<DrawingPlane>? EventAddPlane;
public FormPlaneConfig()
{
InitializeComponent();
panelColorRed.MouseDown += panelColor_MouseDown;
panelColorYellow.MouseDown += panelColor_MouseDown;
panelColorLightBlue.MouseDown += panelColor_MouseDown;
panelColorGreen.MouseDown += panelColor_MouseDown;
panelColorBrown.MouseDown += panelColor_MouseDown;
panelColorBlue.MouseDown += panelColor_MouseDown;
panelColorPurple.MouseDown += panelColor_MouseDown;
panelColorPink.MouseDown += panelColor_MouseDown;
buttonCancel.Click += (sender, e) => Close();
}
/// <summary>
/// Добавление события
/// </summary>
/// <param name="ev">Привязанный метод</param>
public void AddEvent(Action<DrawingPlane> ev)
{
if (EventAddPlane == null)
{
EventAddPlane = ev;
}
else
{
EventAddPlane += ev;
}
}
/// <summary>
/// Отрисовать машину
/// </summary>
private void DrawPlane()
{
Bitmap bmp = new(pictureBoxObject.Width, pictureBoxObject.Height);
Graphics gr = Graphics.FromImage(bmp);
_plane?.SetPosition((int)((pictureBoxObject.Width - _plane?.GetWidth) / 2), (int)((pictureBoxObject.Height - _plane?.GetHeight) / 2));
_plane?.DrawTransport(gr);
pictureBoxObject.Image = bmp;
}
private void buttonApply_Click(object sender, EventArgs e)
{
EventAddPlane?.Invoke(_plane);
Close();
}
private void panelControlObject_DragEnter(object sender, DragEventArgs e)
{
if (e.Data?.GetDataPresent(DataFormats.Text) ?? false)
{
e.Effect = DragDropEffects.Copy;
}
else
{
e.Effect = DragDropEffects.None;
}
}
private void panelControlObject_DragDrop(object sender, DragEventArgs e)
{
switch (e.Data?.GetData(DataFormats.Text).ToString())
{
case "labelPlane":
_plane = new DrawingPlane((int)numericUpDownSpeed.Value, (int)numericUpDownWeight.Value, Color.White, pictureBoxObject.Width, pictureBoxObject.Height);
break;
case "labelStormtrooper":
_plane = new DrawingStormtrooper((int)numericUpDownSpeed.Value, (int)numericUpDownWeight.Value, Color.White, Color.Black, checkBoxRockets.Checked, checkBoxBombs.Checked, pictureBoxObject.Width, pictureBoxObject.Height);
break;
}
DrawPlane();
}
private void labelObject_MouseDown(object sender, MouseEventArgs e)
{
(sender as Label)?.DoDragDrop((sender as Label)?.Name, DragDropEffects.Move | DragDropEffects.Copy);
}
private void panelColor_MouseDown(object sender, MouseEventArgs e)
{
(sender as Panel)?.DoDragDrop((sender as Panel)?.BackColor, DragDropEffects.Move | DragDropEffects.Copy);
}
private void labelColor_DragEnter(object sender, DragEventArgs e)
{
if (e.Data?.GetDataPresent(typeof(Color)) ?? false)
{
e.Effect = DragDropEffects.Copy;
}
else
{
e.Effect = DragDropEffects.None;
}
}
private void labelColor_DragDrop(object sender, DragEventArgs e)
{
if (_plane == null)
return;
_plane.EntityPlane.SetColor((Color)e.Data.GetData(typeof(Color).ToString()));
DrawPlane();
}
private void labelAddColor_DragDrop(object sender, DragEventArgs e)
{
if (_plane == null || _plane is not DrawingStormtrooper)
return;
(_plane.EntityPlane as EntityStormtrooper).SetAdditionalColor((Color)e.Data.GetData(typeof(Color).ToString()));
DrawPlane();
}
}
}

View File

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

View File

@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjStormtrooper
{
/// <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(Direction direction);
/// <summary>
/// Изменение направления перемещения объекта
/// </summary>
/// <param name="direction">Направление</param>
void MoveObject(Direction direction);
}
}

View File

@ -0,0 +1,58 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjStormtrooper
{
/// <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,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjStormtrooper
{
public class MoveToRightBottom : AbstractStrategy
{
protected override bool IsTargetDestinaion()
{
var objParams = GetObjectParameters;
if (objParams == null)
{
return false;
}
return objParams.RightBorder >= FieldWidth - GetStep() && objParams.DownBorder >= FieldHeight - GetStep();
}
protected override void MoveToTarget()
{
var objParams = GetObjectParameters;
if (objParams == null)
{
return;
}
if (objParams.RightBorder < FieldWidth - GetStep())
{
MoveRight();
}
if (objParams.TopBorder < FieldHeight - GetStep())
{
MoveDown();
}
}
}
}

View File

@ -0,0 +1,57 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjStormtrooper
{
/// <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

@ -0,0 +1,202 @@
namespace ProjStormtrooper
{
partial class PlaneCollection
{
/// <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()
{
groupBoxTools = new GroupBox();
groupBoxStorages = new GroupBox();
buttonRemoveStorage = new Button();
buttonAddStorage = new Button();
textBoxStorageName = new TextBox();
listBoxStorages = new ListBox();
maskedTextBoxNumber = new MaskedTextBox();
buttonRefreshCollection = new Button();
buttonRemovePlane = new Button();
buttonAddPlane = new Button();
pictureBoxCollection = new PictureBox();
groupBoxTools.SuspendLayout();
groupBoxStorages.SuspendLayout();
((System.ComponentModel.ISupportInitialize)pictureBoxCollection).BeginInit();
SuspendLayout();
//
// groupBoxTools
//
groupBoxTools.Controls.Add(groupBoxStorages);
groupBoxTools.Controls.Add(maskedTextBoxNumber);
groupBoxTools.Controls.Add(buttonRefreshCollection);
groupBoxTools.Controls.Add(buttonRemovePlane);
groupBoxTools.Controls.Add(buttonAddPlane);
groupBoxTools.Dock = DockStyle.Right;
groupBoxTools.Location = new Point(689, 0);
groupBoxTools.Margin = new Padding(3, 2, 3, 2);
groupBoxTools.Name = "groupBoxTools";
groupBoxTools.Padding = new Padding(3, 2, 3, 2);
groupBoxTools.Size = new Size(201, 404);
groupBoxTools.TabIndex = 0;
groupBoxTools.TabStop = false;
groupBoxTools.Text = "Инструменты";
//
// groupBoxStorages
//
groupBoxStorages.Controls.Add(buttonRemoveStorage);
groupBoxStorages.Controls.Add(buttonAddStorage);
groupBoxStorages.Controls.Add(textBoxStorageName);
groupBoxStorages.Controls.Add(listBoxStorages);
groupBoxStorages.Location = new Point(6, 21);
groupBoxStorages.Name = "groupBoxStorages";
groupBoxStorages.Size = new Size(189, 204);
groupBoxStorages.TabIndex = 6;
groupBoxStorages.TabStop = false;
groupBoxStorages.Text = "Наборы";
//
// buttonRemoveStorage
//
buttonRemoveStorage.Location = new Point(6, 175);
buttonRemoveStorage.Name = "buttonRemoveStorage";
buttonRemoveStorage.Size = new Size(177, 23);
buttonRemoveStorage.TabIndex = 8;
buttonRemoveStorage.Text = "Удалить набор";
buttonRemoveStorage.UseVisualStyleBackColor = true;
buttonRemoveStorage.Click += buttonRemoveStorage_Click;
//
// buttonAddStorage
//
buttonAddStorage.Location = new Point(6, 51);
buttonAddStorage.Name = "buttonAddStorage";
buttonAddStorage.Size = new Size(177, 23);
buttonAddStorage.TabIndex = 7;
buttonAddStorage.Text = "Добавить набор";
buttonAddStorage.UseVisualStyleBackColor = true;
buttonAddStorage.Click += buttonAddStorage_Click;
//
// textBoxStorageName
//
textBoxStorageName.Location = new Point(6, 22);
textBoxStorageName.Name = "textBoxStorageName";
textBoxStorageName.Size = new Size(177, 23);
textBoxStorageName.TabIndex = 6;
textBoxStorageName.TextChanged += textBoxStorageName_TextChanged;
//
// listBoxStorages
//
listBoxStorages.FormattingEnabled = true;
listBoxStorages.ItemHeight = 15;
listBoxStorages.Location = new Point(6, 79);
listBoxStorages.Name = "listBoxStorages";
listBoxStorages.Size = new Size(177, 94);
listBoxStorages.TabIndex = 5;
listBoxStorages.SelectedIndexChanged += listBoxStorages_SelectedIndexChanged;
//
// maskedTextBoxNumber
//
maskedTextBoxNumber.Location = new Point(5, 318);
maskedTextBoxNumber.Margin = new Padding(3, 2, 3, 2);
maskedTextBoxNumber.Mask = "00";
maskedTextBoxNumber.Name = "maskedTextBoxNumber";
maskedTextBoxNumber.Size = new Size(191, 23);
maskedTextBoxNumber.TabIndex = 4;
maskedTextBoxNumber.TextAlign = HorizontalAlignment.Center;
maskedTextBoxNumber.ValidatingType = typeof(int);
//
// buttonRefreshCollection
//
buttonRefreshCollection.Location = new Point(5, 371);
buttonRefreshCollection.Margin = new Padding(3, 2, 3, 2);
buttonRefreshCollection.Name = "buttonRefreshCollection";
buttonRefreshCollection.Size = new Size(191, 22);
buttonRefreshCollection.TabIndex = 3;
buttonRefreshCollection.Text = "Обновить коллекцию";
buttonRefreshCollection.UseVisualStyleBackColor = true;
buttonRefreshCollection.Click += buttonRefreshCollection_Click;
//
// buttonRemovePlane
//
buttonRemovePlane.Location = new Point(5, 345);
buttonRemovePlane.Margin = new Padding(3, 2, 3, 2);
buttonRemovePlane.Name = "buttonRemovePlane";
buttonRemovePlane.Size = new Size(191, 22);
buttonRemovePlane.TabIndex = 2;
buttonRemovePlane.Text = "Удалить самолет";
buttonRemovePlane.UseVisualStyleBackColor = true;
buttonRemovePlane.Click += buttonRemovePlane_Click;
//
// buttonAddPlane
//
buttonAddPlane.Location = new Point(4, 292);
buttonAddPlane.Margin = new Padding(3, 2, 3, 2);
buttonAddPlane.Name = "buttonAddPlane";
buttonAddPlane.Size = new Size(191, 22);
buttonAddPlane.TabIndex = 0;
buttonAddPlane.Text = "Добавить самолет";
buttonAddPlane.UseVisualStyleBackColor = true;
buttonAddPlane.Click += buttonAddPlane_Click;
//
// pictureBoxCollection
//
pictureBoxCollection.Dock = DockStyle.Fill;
pictureBoxCollection.Location = new Point(0, 0);
pictureBoxCollection.Margin = new Padding(3, 2, 3, 2);
pictureBoxCollection.Name = "pictureBoxCollection";
pictureBoxCollection.Size = new Size(689, 404);
pictureBoxCollection.TabIndex = 1;
pictureBoxCollection.TabStop = false;
pictureBoxCollection.Click += pictureBoxCollection_Click;
//
// PlaneCollection
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(890, 404);
Controls.Add(pictureBoxCollection);
Controls.Add(groupBoxTools);
Margin = new Padding(3, 2, 3, 2);
Name = "PlaneCollection";
Text = "Набор самолетов";
groupBoxTools.ResumeLayout(false);
groupBoxTools.PerformLayout();
groupBoxStorages.ResumeLayout(false);
groupBoxStorages.PerformLayout();
((System.ComponentModel.ISupportInitialize)pictureBoxCollection).EndInit();
ResumeLayout(false);
}
#endregion
private GroupBox groupBoxTools;
private Button buttonRefreshCollection;
private Button buttonRemovePlane;
private Button buttonAddPlane;
private MaskedTextBox maskedTextBoxNumber;
private PictureBox pictureBoxCollection;
private GroupBox groupBoxStorages;
private TextBox textBoxStorageName;
private ListBox listBoxStorages;
private Button buttonAddStorage;
private Button buttonRemoveStorage;
}
}

View File

@ -0,0 +1,163 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ProjStormtrooper
{
/// <summary>
/// Форма для работы с набором объектов класса DrawningPlane
/// </summary>
public partial class PlaneCollection : Form
{
/// <summary>
/// Набор объектов
/// </summary>
private readonly PlanesGenericStorage _storage;
/// <summary>
/// Конструктор
/// </summary>
public PlaneCollection()
{
InitializeComponent();
_storage = new PlanesGenericStorage(pictureBoxCollection.Width, pictureBoxCollection.Height);
}
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>
///
public void AddPlaneListener(DrawingPlane plane)
{
plane._pictureWidth = pictureBoxCollection.Width;
plane._pictureHeight = pictureBoxCollection.Height;
if (listBoxStorages.SelectedIndex == -1)
{
return;
}
var obj = _storage[listBoxStorages.SelectedItem.ToString() ?? string.Empty];
if (obj == null)
{
return;
}
if (obj + plane > -1)
{
MessageBox.Show("Объект добавлен");
pictureBoxCollection.Image = obj.ShowPlanes();
}
else
{
MessageBox.Show("Не удалось добавить объект");
}
}
private void buttonAddPlane_Click(object sender, EventArgs e)
{
var formPlaneConfig = new FormPlaneConfig();
formPlaneConfig.AddEvent(AddPlaneListener);
formPlaneConfig.Show();
}
/// <summary>
/// Удаление объекта из набора
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void buttonRemovePlane_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("Удалить объект?", "Удаление", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
{
return;
}
int pos = Convert.ToInt32(maskedTextBoxNumber.Text);
if (obj - pos != null)
{
MessageBox.Show("Объект удален");
pictureBoxCollection.Image = obj.ShowPlanes();
}
else
{
MessageBox.Show("Не удалось удалить объект");
}
}
/// <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.ShowPlanes();
}
private void buttonAddStorage_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(textBoxStorageName.Text))
{
MessageBox.Show("Не все данные заполнены", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
_storage.AddSet(textBoxStorageName.Text);
ReloadObjects();
}
private void listBoxStorages_SelectedIndexChanged(object sender, EventArgs e)
{
pictureBoxCollection.Image = _storage[listBoxStorages.SelectedItem?.ToString() ?? string.Empty]?.ShowPlanes();
}
private void buttonRemoveStorage_Click(object sender, EventArgs e)
{
if (listBoxStorages.SelectedIndex == -1)
{
return;
}
if (MessageBox.Show($"Удалить объект {listBoxStorages.SelectedItem}?", "Удаление", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
_storage.DelSet(listBoxStorages.SelectedItem.ToString() ?? string.Empty);
ReloadObjects();
}
}
}
}

View File

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

View File

@ -0,0 +1,146 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjStormtrooper
{
/// <summary>
/// Параметризованный класс для набора объектов DrawningPlane
/// </summary>
/// <typeparam name="T"></typeparam>
/// <typeparam name="U"></typeparam>
internal class PlanesGenericCollection<T, U>
where T : DrawingPlane
where U : IMoveableObject
{
/// <summary>
/// Ширина окна прорисовки
/// </summary>
private readonly int _pictureWidth;
/// <summary>
/// Высота окна прорисовки
/// </summary>
private readonly int _pictureHeight;
/// <summary>
/// Размер занимаемого объектом места (ширина)
/// </summary>
private readonly int _placeSizeWidth = 160;
/// <summary>
/// Размер занимаемого объектом места (высота)
/// </summary>
private readonly int _placeSizeHeight = 120;
/// <summary>
/// Набор объектов
/// </summary>
private readonly SetGeneric<T> _collection;
/// <summary>
/// Конструктор
/// </summary>
/// <param name="picWidth"></param>
/// <param name="picHeight"></param>
public PlanesGenericCollection(int picWidth, int picHeight)
{
int horizontalObjectsCount = picWidth / _placeSizeWidth;
int verticalObjectsCount = picHeight / _placeSizeHeight;
_pictureWidth = picWidth;
_pictureHeight = picHeight;
_collection = new SetGeneric<T>(horizontalObjectsCount * verticalObjectsCount);
}
/// <summary>
/// Перегрузка оператора сложения
/// </summary>
/// <param name="collect"></param>
/// <param name="obj"></param>
/// <returns></returns>
public static int operator +(PlanesGenericCollection<T, U> collect, T? obj)
{
if (obj == null)
{
return -1;
}
return collect?._collection.Insert(obj) ?? -1;
}
/// <summary>
/// Перегрузка оператора вычитания
/// </summary>
/// <param name="collect"></param>
/// <param name="pos"></param>
/// <returns></returns>
public static T? operator -(PlanesGenericCollection<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 ShowPlanes()
{
Bitmap bmp = new(_pictureWidth, _pictureHeight);
Graphics gr = Graphics.FromImage(bmp);
DrawBackground(gr);
DrawObjects(gr);
return bmp;
}
/// <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>
/// <param name="g"></param>
private void DrawObjects(Graphics g)
{
int width = _pictureWidth / _placeSizeWidth;
int height = _pictureHeight / _placeSizeHeight;
for (int i = 0; i < _collection.Count; i++)
{
var obj = _collection[i];
obj?.SetPosition(
(int)((width - 1) * _placeSizeWidth - (i % width * _placeSizeWidth)),
(int)((i / width) * _placeSizeHeight)
);
obj?.DrawTransport(g);
}
}
}
}

View File

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjStormtrooper
{
internal class PlanesGenericStorage
{
/// <summary>
/// Словарь (хранилище)
/// </summary>
readonly Dictionary<string, PlanesGenericCollection<DrawingPlane, DrawingObjectPlane>> _planeStorages;
/// <summary>
/// Возвращение списка названий наборов
/// </summary>
public List<string> Keys => _planeStorages.Keys.ToList();
/// <summary>
/// Ширина окна отрисовки
/// </summary>
private readonly int _pictureWidth;
/// <summary>
/// Высота окна отрисовки
/// </summary>
private readonly int _pictureHeight;
/// <summary>
/// Конструктор
/// </summary>
/// <param name="pictureWidth"></param>
/// <param name="pictureHeight"></param>
public PlanesGenericStorage(int pictureWidth, int pictureHeight)
{
_planeStorages = new Dictionary<string, PlanesGenericCollection<DrawingPlane, DrawingObjectPlane>>();
_pictureWidth = pictureWidth;
_pictureHeight = pictureHeight;
}
/// <summary>
/// Добавление набора
/// </summary>
/// <param name="name">Название набора</param>
public void AddSet(string name)
{
_planeStorages.Add(name, new PlanesGenericCollection<DrawingPlane, DrawingObjectPlane>(_pictureWidth, _pictureHeight));
}
/// <summary>
/// Удаление набора
/// </summary>
/// <param name="name">Название набора</param>
public void DelSet(string name)
{
if (_planeStorages.ContainsKey(name))
_planeStorages.Remove(name);
}
/// <summary>
/// Доступ к набору
/// </summary>
/// <param name="ind"></param>
/// <returns></returns>
public PlanesGenericCollection<DrawingPlane, DrawingObjectPlane>? this[string ind]
{
get
{
if (_planeStorages.ContainsKey(ind))
return _planeStorages[ind];
return null;
}
}
}
}

View File

@ -0,0 +1,17 @@
namespace ProjStormtrooper
{
internal static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
// To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();
Application.Run(new PlaneCollection());
}
}
}

View File

@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<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,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Этот код создан программой.
// Исполняемая версия:4.0.30319.42000
//
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
// повторной генерации кода.
// </auto-generated>
//------------------------------------------------------------------------------
namespace ProjStormtrooper.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("ProjStormtrooper.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;
}
}
}
}

View File

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

View File

@ -0,0 +1,122 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjStormtrooper
{
/// <summary>
/// Параметризованный набор объектов
/// </summary>
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="plane"></param>
/// <returns></returns>
public int Insert(T plane)
{
return Insert(plane, 0);
}
/// <summary>
/// Добавление объекта в набор на конкретную позицию
/// </summary>
/// <param name="plane"></param>
/// <param name="position"></param>
/// <returns></returns>
public int Insert(T plane, int position)
{
// Проверка позиции
if (position < 0 || position >= _maxCount)
{
return -1;
}
// Вставка по позиции
_places.Insert(position, plane);
return position;
}
/// <summary>
/// Удаление объекта из набора с конкретной позиции
/// </summary>
/// <param name="position"></param>
/// <returns></returns>
public T? Remove(int position)
{
// Проверка позиции
if (position < 0 || position >= Count)
{
return null;
}
// Удаление объекта из массива, присвоив элементу массива значение null
T? plane = _places[position];
_places[position] = null;
return plane;
}
/// <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 >= _maxCount || Count == _maxCount)
{
return;
}
// Вставка в список по позиции
_places.Insert(position, value);
}
}
/// <summary>
/// Проход по списку
/// </summary>
/// <returns></returns>
public IEnumerable<T?> GetPlanes(int? maxPlanes = null)
{
for (int i = 0; i < _places.Count; ++i)
{
yield return _places[i];
if (maxPlanes.HasValue && i == maxPlanes.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 ProjStormtrooper
{
/// <summary>
/// Статус выполнения операции перемещения
/// </summary>
public enum Status
{
NotInit,
InProgress,
Finish
}
}

View File

@ -0,0 +1,196 @@
namespace ProjStormtrooper
{
partial class Stormtrooper
{
/// <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(Stormtrooper));
pictureBoxStormtrooper = new PictureBox();
buttonDown = new Button();
buttonUp = new Button();
buttonLeft = new Button();
buttonRight = new Button();
buttonCreateStormtrooper = new Button();
buttonCreatePlane = new Button();
buttonStep = new Button();
comboBoxStrategy = new ComboBox();
buttonSelectPlane = new Button();
((System.ComponentModel.ISupportInitialize)pictureBoxStormtrooper).BeginInit();
SuspendLayout();
//
// pictureBoxStormtrooper
//
pictureBoxStormtrooper.Dock = DockStyle.Fill;
pictureBoxStormtrooper.Location = new Point(0, 0);
pictureBoxStormtrooper.Name = "pictureBoxStormtrooper";
pictureBoxStormtrooper.Size = new Size(884, 461);
pictureBoxStormtrooper.SizeMode = PictureBoxSizeMode.AutoSize;
pictureBoxStormtrooper.TabIndex = 0;
pictureBoxStormtrooper.TabStop = false;
pictureBoxStormtrooper.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(806, 419);
buttonDown.Name = "buttonDown";
buttonDown.Size = new Size(30, 30);
buttonDown.TabIndex = 2;
buttonDown.UseVisualStyleBackColor = true;
buttonDown.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(806, 383);
buttonUp.Name = "buttonUp";
buttonUp.Size = new Size(30, 30);
buttonUp.TabIndex = 3;
buttonUp.UseVisualStyleBackColor = true;
buttonUp.Click += buttonMove_Click;
//
// buttonLeft
//
buttonLeft.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
buttonLeft.BackgroundImage = (Image)resources.GetObject("buttonLeft.BackgroundImage");
buttonLeft.BackgroundImageLayout = ImageLayout.Zoom;
buttonLeft.Location = new Point(770, 419);
buttonLeft.Name = "buttonLeft";
buttonLeft.Size = new Size(30, 30);
buttonLeft.TabIndex = 4;
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(842, 419);
buttonRight.Name = "buttonRight";
buttonRight.Size = new Size(30, 30);
buttonRight.TabIndex = 5;
buttonRight.UseVisualStyleBackColor = true;
buttonRight.Click += buttonMove_Click;
//
// buttonCreateStormtrooper
//
buttonCreateStormtrooper.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
buttonCreateStormtrooper.Location = new Point(12, 428);
buttonCreateStormtrooper.Margin = new Padding(3, 2, 3, 2);
buttonCreateStormtrooper.Name = "buttonCreateStormtrooper";
buttonCreateStormtrooper.Size = new Size(176, 22);
buttonCreateStormtrooper.TabIndex = 7;
buttonCreateStormtrooper.Text = "Создать штурмовик";
buttonCreateStormtrooper.UseVisualStyleBackColor = true;
buttonCreateStormtrooper.Click += buttonCreateStormtrooper_Click;
//
// buttonCreatePlane
//
buttonCreatePlane.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
buttonCreatePlane.Location = new Point(194, 428);
buttonCreatePlane.Margin = new Padding(3, 2, 3, 2);
buttonCreatePlane.Name = "buttonCreatePlane";
buttonCreatePlane.Size = new Size(176, 22);
buttonCreatePlane.TabIndex = 8;
buttonCreatePlane.Text = "Создать самолет";
buttonCreatePlane.UseVisualStyleBackColor = true;
buttonCreatePlane.Click += buttonCreatePlane_Click;
//
// buttonStep
//
buttonStep.Location = new Point(790, 38);
buttonStep.Margin = new Padding(3, 2, 3, 2);
buttonStep.Name = "buttonStep";
buttonStep.Size = new Size(82, 22);
buttonStep.TabIndex = 9;
buttonStep.Text = "Шаг";
buttonStep.UseVisualStyleBackColor = true;
buttonStep.Click += buttonStep_Click;
//
// comboBoxStrategy
//
comboBoxStrategy.DropDownStyle = ComboBoxStyle.DropDownList;
comboBoxStrategy.FormattingEnabled = true;
comboBoxStrategy.Items.AddRange(new object[] { "MoveToCenter", "MoveToRightBottom" });
comboBoxStrategy.Location = new Point(739, 11);
comboBoxStrategy.Margin = new Padding(3, 2, 3, 2);
comboBoxStrategy.Name = "comboBoxStrategy";
comboBoxStrategy.Size = new Size(133, 23);
comboBoxStrategy.TabIndex = 10;
//
// buttonSelectPlane
//
buttonSelectPlane.Location = new Point(376, 428);
buttonSelectPlane.Name = "buttonSelectPlane";
buttonSelectPlane.Size = new Size(198, 23);
buttonSelectPlane.TabIndex = 11;
buttonSelectPlane.Text = "выбрать";
buttonSelectPlane.UseVisualStyleBackColor = true;
buttonSelectPlane.Click += buttonSelectPlane_Click;
//
// Stormtrooper
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(884, 461);
Controls.Add(buttonSelectPlane);
Controls.Add(comboBoxStrategy);
Controls.Add(buttonStep);
Controls.Add(buttonCreatePlane);
Controls.Add(buttonCreateStormtrooper);
Controls.Add(buttonRight);
Controls.Add(buttonLeft);
Controls.Add(buttonUp);
Controls.Add(buttonDown);
Controls.Add(pictureBoxStormtrooper);
Name = "Stormtrooper";
StartPosition = FormStartPosition.CenterScreen;
Text = "Form1";
((System.ComponentModel.ISupportInitialize)pictureBoxStormtrooper).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion
private PictureBox pictureBoxStormtrooper;
private Button buttonDown;
private Button buttonUp;
private Button buttonLeft;
private Button buttonRight;
private Button buttonCreateStormtrooper;
private Button buttonCreatePlane;
private Button buttonStep;
private ComboBox comboBoxStrategy;
private Button buttonSelectPlane;
}
}

View File

@ -0,0 +1,180 @@
using ProjStormtrooper;
using System.ComponentModel;
using System.Windows.Forms.Layout;
namespace ProjStormtrooper
{
public partial class Stormtrooper : Form
{
/// <summary>
/// Ïîëå-îáúåêò äëÿ ïðîðèñîâêè îáúåêòà
/// </summary>
private DrawingPlane? _drawingPlane;
/// <summary>
/// Ñòðàòåãèÿ ïåðåìåùåíèÿ
/// </summary>
private AbstractStrategy? _strategy;
/// <summary>
/// Âûáðàííûé àâòîìîáèëü
/// </summary>
public DrawingPlane? SelectedPlane { get; private set; }
/// <summary>
/// Èíèöèàëèçàöèÿ ôîðìû
/// </summary>
public Stormtrooper()
{
InitializeComponent();
_strategy = null;
SelectedPlane = null;
}
/// <summary>
/// Ìåòîä ïðîðèñîâêè îáúåêòà
/// </summary>
private void Draw()
{
if (_drawingPlane == null)
{
return;
}
Bitmap bmp = new(pictureBoxStormtrooper.Width, pictureBoxStormtrooper.Height);
Graphics g = Graphics.FromImage(bmp);
_drawingPlane.DrawTransport(g);
pictureBoxStormtrooper.Image = bmp;
}
/// <summary>
/// Îáðàáîò÷èê íàæàòèÿ êíîïêè "Ñîçäàòü øòóðìîâèê"
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void buttonCreateStormtrooper_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;
}
Color dopColor = Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256));
dialog = new();
if (dialog.ShowDialog() == DialogResult.OK)
{
dopColor = dialog.Color;
}
_drawingPlane = new DrawingStormtrooper(
random.Next(100, 300),
random.Next(1000, 3000),
color,
dopColor,
Convert.ToBoolean(random.Next(0, 2)),
Convert.ToBoolean(random.Next(0, 2)),
pictureBoxStormtrooper.Width,
pictureBoxStormtrooper.Height
);
_drawingPlane.SetPosition(random.Next(10, 100), random.Next(10, 100));
Draw();
}
/// <summary>
/// Îáðàáîò÷èê íàæàòèÿ êíîïêè "Ñîçäàòü ñàìîëåò"
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void buttonCreatePlane_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;
}
_drawingPlane = new DrawingPlane(
random.Next(100, 300),
random.Next(1000, 3000),
color,
pictureBoxStormtrooper.Width,
pictureBoxStormtrooper.Height
);
_drawingPlane.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 (_drawingPlane == null)
{
return;
}
string buttonName = ((Button)sender)?.Name ?? string.Empty;
switch (buttonName)
{
case "buttonUp":
_drawingPlane.MoveTransport(Direction.Up);
break;
case "buttonDown":
_drawingPlane.MoveTransport(Direction.Down);
break;
case "buttonLeft":
_drawingPlane.MoveTransport(Direction.Left);
break;
case "buttonRight":
_drawingPlane.MoveTransport(Direction.Right);
break;
}
Draw();
}
/// <summary>
/// Îáðàáîòêà íàæàòèÿ êíîïêè "Øàã"
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void buttonStep_Click(object sender, EventArgs e)
{
if (_drawingPlane == null)
{
return;
}
if (comboBoxStrategy.Enabled)
{
_strategy = comboBoxStrategy.SelectedIndex switch
{
0 => new MoveToCenter(),
1 => new MoveToRightBottom(),
_ => null,
};
if (_strategy == null)
{
return;
}
_strategy.SetData(new DrawingObjectPlane(_drawingPlane), pictureBoxStormtrooper.Width, pictureBoxStormtrooper.Height);
}
if (_strategy == null)
{
return;
}
comboBoxStrategy.Enabled = false;
_strategy.MakeStep();
Draw();
if (_strategy.GetStatus() == Status.Finish)
{
comboBoxStrategy.Enabled = true;
_strategy = null;
}
}
/// <summary>
/// Âûáîð ñàìîëåòà
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void buttonSelectPlane_Click(object sender, EventArgs e)
{
SelectedPlane = _drawingPlane;
DialogResult = DialogResult.OK;
}
}
}

View File

@ -0,0 +1,328 @@
<?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="buttonDown.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAANQAAADuCAMAAAB24dnhAAAABGdBTUEAALGPC/xhBQAAAHtQTFRFAAAA
////7u7u7e3t9fX1+Pj48/Pz+/v79PT0fn5+UFBQ5+fnMzMzs7Oz19fXb29vjY2NtLS00tLSpaWlHh4e
vLy8U1NTOzs7CgoKTExMysrK4eHhLy8vFBQUNzc3a2trk5OTXV1denp6JycnnJycIyMjWlpaREREw8PD
TPw7owAAAAlwSFlzAAAOvAAADrwBlbxySQAACpZJREFUeF7tnel2ozgQhQNiceI4e2dzMr1MT3e//xNO
lbgFRVo2SyQWH30/cuIbTOmmMCoJgc/SNDVJjaGXlgJCkpSimQxKkmS1lifJmWfObYhchwAbSKkpoSQJ
lJaLaApKNDWcaMqjqVZEtMUbMVMxU8vMVK11m0rxO+EyBSVNlSkoaRrOFALYEKDOVNqYKqC0TPEPI2h7
QmMvh2Ja/7wApjiEPiyEJmwBxSgrKRRjKlMwq3JWH3QqZ+7DPIQpCnHgWAeu/EAhPmsqC5KpmU3FTPUj
Zipm6rQz1eqnRJs/U7UGgYBCWFP4XWelqSM2UMgUFN3JZ0UAUxxCmbIhGUemXLVFesY9MF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Vrwc1kgEI4Q6zJl
O+HvHBgC4QixLlP8FJzq6bcQCEeIdZky+etLaf8AgXCE8GEqTf8HdnQJUTEEfskAAAAASUVORK5CYII=
</value>
</data>
<data name="buttonUp.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAANQAAADuCAMAAAB24dnhAAAABGdBTUEAALGPC/xhBQAAAHtQTFRFAAAA
////7u7u7e3t9fX1+Pj48/Pz+/v79PT0fn5+UFBQ5+fnMzMzs7Oz19fXb29vjY2NtLS00tLSpaWlHh4e
vLy8U1NTOzs7CgoKTExMysrK4eHhLy8vFBQUNzc3a2trk5OTXV1denp6JycnnJycIyMjWlpaREREw8PD
TPw7owAAAAlwSFlzAAAOvAAADrwBlbxySQAACthJREFUeF7tnet62ygURSXr5tS5p0kTO22nTWam7/+E
c4ANHNlYxjLIyMP60a/aUYJWkMwRwk6xMJSGCsmiRVCWjc6qGklZ1ibrkJRli2hRISDEZtu9rRuWOZro
HE3YZhskvAnbLBI0O5VUc1W8V0sEhKOJ2UmVv4qi+FghIBxNzEyqKp/IqSjeEBCOJmYmVf4lnYriH7Oj
o4l5SZXPcCqKn0jmL/X8CiXiHpmjiVlJPX6HkARWjibmJHV7DR1wI1NHE95SjmaRoFmXlPnpXArJYsGk
kNAohMQl9Q0yhkeRuqSQ8CZss44mFnulZCapNFxPY8fNBknV++VpWDtis22/QIVxS7817ETIbxPw00LD
TwvNVhMSBITY4lKQdfYZl0LEpJaIts4IOs6fEOF8rLoDp4WjCd9XJbFbTClyuoNHn++stBiWOvYCji/V
lvew2ObNHsXcpOp9TmRl9puZVHcDAxe/9eEOS6V2TZV/cPxufmOvefXULSuOXHyq3c4o1RundGalHIP8
6oCTLi1sEyOkTIaAEBGTUl8n7E/3HeRNT5lBfvWOQx9AWtkm2O8NCW9isHzZqi0KOSALbP+cMsir2qJZ
bBV8bv5QS/y00PDTQsNPCw0Col9bRClo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NBkucozi418KokmKdU7ikFkpSlck9JkKQsFbWneuOUzs7fUyZjUiYTWyf/CYwIUgn8
CYzwUqwJflpobP+c+NENA2dEFCndRP9cVxmTQqROOoXYLUtJstQYLl5KNSHIPYX/E0bgEqV645TO0pQy
GQKChtnT/wRGBKkDdcRwJrZSnKMYKF8Eto6wfZb+HMVl3k9lKQmSLJWlTuVCpfaP9AIPKby8X9Y4JT+d
UYLPZyQQEAgIBAQCRBGklq5msU0gIBAQCAixxWs/je2zPEcRCt5E/wJWGZNCpK4khdgtcSl7JV2Q1EX2
VJaSiN2ylGRmUhoupeFSmohSGi6lYVJIdsYpOSCPJ0ZFMeKPXvTJcxSCrdM8zSodG4T8quTMUqyJy5HK
PaVAkrBU7ikFkoSlTu8pvLxf1jiFQZjATT6BgEBAICAQIIogtd2EBAGBgEBAICDE1mXWfvg/Ya4kLoVk
vlW62oFAkKXCkaUUWersUqoJQe4p/J+QL/gCLqXhUpqIUhoupWFSSHbGKbkMQeC7eiL+yszad2WmzY78
Exhg3xlxjirdZLbPhj5eEug98v1UMPL9FECSsFTuKQWShKVyTymQaCk5IAu4lIZLabgUEaOn9pcvAo85
CjkgSzAkEwiSX5nZryMUYstR0PZqP53tPyPCS+0911Vm+8fjfb56D3Z15fupUGQpRZbKUqHIUooBKQ2X
0nApTUQpDZfSMCkkO3MUSpWwJZH9FApWJiGZ4hOuWtuE65Mplkj4p1CYPpMdMljQzmiOQiP7LN9PCRLo
KUS5p3JP5Z7yI/cUQKKl5IAs4FIaLqXhUkSMntpfvghcdcTWHIXMJI7+sbUFawfJJJ9wxX6DSJx1BNcj
XFK2z0xBm+gcBSIuJXbzlBo4zaNK2ZPugqRyT0nEbrmnJFlqDFlKcflSi8V/mZMJUYvwpvEAAAAASUVO
RK5CYII=
</value>
</data>
<data name="buttonLeft.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAO4AAADUC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Z0PbKuR9b1yLoe1NWTDcdY13NjWTIxVsWZ6YBzqQCDs5u5
OGomMmuYGFPjddqpU6IHFUqsVpaEjAFgAK4eIoiFO2xfU706Go5mas7KxCHCsrLMwnoeeimxnlc5IpJ1
7cO2vj6ClfkB4Hnd699CKk63unqZ5/J0tXqjW4TydPFylydBF6iLuq+XbjdQpu7FSdCfqMt2AzABDG4f
NDrGRzis7kD/exYGdx2r4p94ZS6L0cJlUlXi9rdMqipUq5nIzC7wOr4DPqiwTu9RtieIhyzxEGHUvPpM
1B0yUQMZfi3mm3yIsLBsnzEATMD6R0Qet0jxfiMjHCUdAHr6ulHfcnVBc3YKqWhdfXZ7vcJ1T+folK6r
jqObRRavq46ywdqGrkfW9ci6HlnXI+oyYVPTiknQY13PXco6GIBoz8xALtzQ6IhujolsajomZ01NI+as
XOiZGaxa1sEArH6IENm++sfiOjp3OES4VNYi1vNdj4gIkzCiU+gBIGESfHeiq3kdnd3o9iNY+9F1V0be
ka69y9OedJX68nVXuu2fn6Sr1P8BtxoJUcy/fqEAAAAASUVORK5CYII=
</value>
</data>
<data name="buttonRight.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAO4AAADUCAMAAACs0e/bAAAABGdBTUEAALGPC/xhBQAAAHtQTFRFAAAA
////7u7u7e3t9fX1+Pj48/Pz+/v79PT0fn5+UFBQ5+fnMzMzs7Oz19fXb29vjY2NtLS00tLSpaWlHh4e
vLy8U1NTOzs7CgoKTExMysrK4eHhLy8vFBQUNzc3a2trk5OTXV1denp6JycnnJycIyMjWlpaREREw8PD
TPw7owAAAAlwSFlzAAAOvAAADrwBlbxySQAACPxJREFUeF7lnXtjmjAUxcMbq9W2a31Uu9a22/r9P+Fu
wklycay+ECH3+MfWQ+TwQ4RLDKAipyS2ghFFhfNyOFGUWS/J4ERR6rwCThTlsOIEBgmO8T4xyy5j4+vh
blaV12XsFXFv1MdU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An+tnSYnBX61S/VQjuNtW07eFacVwrjmvFc61YLpy2jrvmkTxa58RWVZURCg8SDBIMEgwSDBKMU95a
Hos7ohUNYWanxA6kZl6+4X2kc2IHckZ0y3ouzokdBK6+cXo7sYPAndLXSwzuYk3hYnAniV4eKbjb3MQI
wd2aXqnWYnt+3P3UDxsyaidWYcARCYOQ8ryEURQZnDxP4XDPD2FK4ezzYJCKg3DvIryxrdiGU4RazWw9
/zk3bUuNtbrzYJBo3s47APeJ3RWvldhenxH9iNqO7TPuA+1DxOD+fNatpeBu9AgTMbjzpBrdIgN3bsfy
iMCdmQdHaV0S14rjWvFcK55rxXLhNHcafYf77t/bdqxCuUHyFQyM8+orGPwSPHZZXvx/3LuoKaKV2OLb
U4RazWy9PbV6w/bFaymr/9fMt7ScaNR+bO/OiO7ppOBysT3D/ZjqcCm4ZoSJGFx93ZNuJwP3JkaKCNxZ
YmcoAXekn9hQ6YK4KDdIcEgwOu2r+uwklhWRWBe1lQsnjks4lAYnjn2a+eHVqGGFxw0rnDalOu4t77m4
XOyBpwi14tV6LNd5PsMXOjBIcIxXwyXaS3aROfXijOjR9Fx0ENsL3KqfRgruYozvIBqFjTs342m00Cho
3K2/5gqNQsbV42ngCcC96za2hmvFc614rhXPtWK5cBrLNeDq655gdBN7zR88l/d6S4ZBQqOLFpH4lElw
SA3bktu+9tXqDdsXnNr2lUQrdW9mAIPUQez1zohmpp+m49ir4eZj7GhgkC4eG0V/AWaKCVFAjQwfAAAA
AElFTkSuQmCC
</value>
</data>
</root>

View File

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.7.34221.43
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProjStormtrooper", "ProjStormtrooper\ProjStormtrooper.csproj", "{92C8545F-7184-42F3-A9D8-DEF885CC394F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{92C8545F-7184-42F3-A9D8-DEF885CC394F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{92C8545F-7184-42F3-A9D8-DEF885CC394F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{92C8545F-7184-42F3-A9D8-DEF885CC394F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{92C8545F-7184-42F3-A9D8-DEF885CC394F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DAC0834C-1138-4E6E-AAFC-4189DB0D3D25}
EndGlobalSection
EndGlobal