Blank
@ -1,34 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace ProjectAntiAircraftGun
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Направленте перемещения
|
|
||||||
/// </summary>
|
|
||||||
public enum DirectionType
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Вверх
|
|
||||||
/// </summary>
|
|
||||||
Up = 1,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Вниз
|
|
||||||
/// </summary>
|
|
||||||
Down = 2,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Влево
|
|
||||||
/// </summary>
|
|
||||||
Left = 3,
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Вправо
|
|
||||||
/// </summary>
|
|
||||||
Right = 4
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,80 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using ProjectAntiAircraftGun.Entities;
|
|
||||||
|
|
||||||
namespace ProjectAntiAircraftGun.DrawingObjects
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Класс, отвечающий за прорисовку и перемещение объекта-сущности
|
|
||||||
/// </summary>
|
|
||||||
public class DrawingAntiAircraftGun : DrawingTank
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Конструктор
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="speed">Скорость</param>
|
|
||||||
/// <param name="weight">Вес</param>
|
|
||||||
/// <param name="bodyColor">Основной цвет</param>
|
|
||||||
/// <param name="additionalColor">Дополнительный цвет</param>
|
|
||||||
/// <param name="radar">Признак наличия радара</param>
|
|
||||||
/// <param name="hatch">Признак наличия люка</param>
|
|
||||||
/// <param name="cannon">Признак наличия пушки</param>
|
|
||||||
/// <param name="width">Ширина картинки</param>
|
|
||||||
/// <param name="height">Высота картинки</param>
|
|
||||||
public DrawingAntiAircraftGun(int speed, double weight, Color bodyColor, Color
|
|
||||||
additionalColor, bool radar, bool hatch, bool cannon, int width, int height) :
|
|
||||||
base(speed, weight, bodyColor, additionalColor, width, height, 102, 139)
|
|
||||||
{
|
|
||||||
if (EntityTank != null)
|
|
||||||
{
|
|
||||||
EntityTank = new EntityAntiAircraftGun(speed, weight, bodyColor,
|
|
||||||
additionalColor, radar, hatch, cannon);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void DrawTransport(Graphics g)
|
|
||||||
{
|
|
||||||
|
|
||||||
if (EntityTank is not EntityAntiAircraftGun antiAircraftGun)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Pen pen = new(Color.Black);
|
|
||||||
pen.Width = 2;
|
|
||||||
Brush brush = new SolidBrush(EntityTank.BodyColor);
|
|
||||||
Brush additionalBrush = new SolidBrush(EntityTank.AdditionalColor);
|
|
||||||
|
|
||||||
base.DrawTransport(g);
|
|
||||||
|
|
||||||
// радар
|
|
||||||
if (antiAircraftGun.Radar)
|
|
||||||
{
|
|
||||||
Pen penRadar = new(Color.DarkGreen);
|
|
||||||
g.DrawEllipse(penRadar, _startPosX + 52, _startPosY + 46, 21, 12);
|
|
||||||
g.DrawEllipse(penRadar, _startPosX + 55, _startPosY + 48, 14, 8);
|
|
||||||
pen = new(Color.Green);
|
|
||||||
g.DrawLine(penRadar, _startPosX + 61, _startPosY + 52, _startPosX + 70, _startPosY + 48);
|
|
||||||
}
|
|
||||||
|
|
||||||
// пушка
|
|
||||||
if (antiAircraftGun.Cannon)
|
|
||||||
{
|
|
||||||
g.DrawLine(pen, _startPosX + 54, _startPosY + 33, _startPosX + 113, _startPosY + 2);
|
|
||||||
g.DrawLine(pen, _startPosX + 57, _startPosY + 35, _startPosX + 122, _startPosY + 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
// люк
|
|
||||||
if (antiAircraftGun.Hatch)
|
|
||||||
{
|
|
||||||
pen = new(antiAircraftGun.AdditionalColor);
|
|
||||||
g.DrawRectangle(pen, _startPosX + 88, _startPosY + 64, 17, 6);
|
|
||||||
g.DrawLine(pen, _startPosX + 88, _startPosY + 67, _startPosX + 105, _startPosY + 67);
|
|
||||||
g.DrawLine(pen, _startPosX + 94, _startPosY + 64, _startPosX + 94, _startPosY + 70);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,269 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using ProjectAntiAircraftGun.Entities;
|
|
||||||
using ProjectAntiAircraftGun.MovementStrategy;
|
|
||||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
|
|
||||||
|
|
||||||
namespace ProjectAntiAircraftGun.DrawingObjects
|
|
||||||
{
|
|
||||||
public class DrawingTank
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Класс-сущность
|
|
||||||
/// </summary>
|
|
||||||
public EntityTank? EntityTank { get; protected set; }
|
|
||||||
/// <summary>
|
|
||||||
/// Ширина окна
|
|
||||||
/// </summary>
|
|
||||||
private int _pictureWidth;
|
|
||||||
/// <summary>
|
|
||||||
/// Высота окна
|
|
||||||
/// </summary>
|
|
||||||
private int _pictureHeight;
|
|
||||||
/// <summary>
|
|
||||||
/// Левая координата прорисовки танка
|
|
||||||
/// </summary>
|
|
||||||
protected int _startPosX;
|
|
||||||
/// <summary>
|
|
||||||
/// Верхняя кооридната прорисовки танка
|
|
||||||
/// </summary>
|
|
||||||
protected int _startPosY;
|
|
||||||
/// <summary>
|
|
||||||
/// Ширина прорисовки танка
|
|
||||||
/// </summary>
|
|
||||||
protected readonly int _tankWidth = 130;
|
|
||||||
/// <summary>
|
|
||||||
/// Высота прорисовки танка
|
|
||||||
/// </summary>
|
|
||||||
protected readonly int _tankHeight = 102;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Координата X объекта
|
|
||||||
/// </summary>
|
|
||||||
public int GetPosX => _startPosX;
|
|
||||||
/// <summary>
|
|
||||||
/// Координата Y объекта
|
|
||||||
/// </summary>
|
|
||||||
public int GetPosY => _startPosY;
|
|
||||||
/// <summary>
|
|
||||||
/// Ширина объекта
|
|
||||||
/// </summary>
|
|
||||||
public int GetWidth => _tankWidth;
|
|
||||||
/// <summary>
|
|
||||||
/// Высота объекта
|
|
||||||
/// </summary>
|
|
||||||
public int GetHeight => _tankHeight;
|
|
||||||
public IMoveableObject GetMoveableObject => new DrawingObjectTank(this);
|
|
||||||
/// <summary>
|
|
||||||
/// Конструктор
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="speed">Скорость</param>
|
|
||||||
/// <param name="weight">Вес</param>
|
|
||||||
/// <param name="bodyColor">Основной цвет</param>
|
|
||||||
/// <param name="additionalColor">Дополнительный цвет</param>
|
|
||||||
/// <param name="width">Ширина картинки</param>
|
|
||||||
/// <param name="height">Высота картинки</param>
|
|
||||||
public DrawingTank(int speed, double weight, Color bodyColor, Color additionalColor, int
|
|
||||||
width, int height)
|
|
||||||
{
|
|
||||||
|
|
||||||
_pictureWidth = width;
|
|
||||||
_pictureHeight = height;
|
|
||||||
EntityTank = new EntityTank(speed, weight, bodyColor, additionalColor);
|
|
||||||
|
|
||||||
if (_pictureWidth > _tankWidth && _pictureHeight > _tankHeight)
|
|
||||||
{
|
|
||||||
EntityTank = new EntityTank(speed, weight, bodyColor, additionalColor);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
EntityTank = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Конструктор
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="speed">Скорость</param>
|
|
||||||
/// <param name="weight">Вес</param>
|
|
||||||
/// <param name="bodyColor">Основной цвет</param>
|
|
||||||
/// <param name="width">Ширина картинки</param>
|
|
||||||
/// <param name="height">Высота картинки</param>
|
|
||||||
/// <param name="tankWidth">Ширина прорисовки танка</param>
|
|
||||||
/// <param name="tankHeight">Высота прорисовки танка</param>
|
|
||||||
protected DrawingTank(int speed, double weight, Color bodyColor, Color additionalColor, int
|
|
||||||
width, int height, int tankWidth, int tankHeight)
|
|
||||||
{
|
|
||||||
_pictureWidth = width;
|
|
||||||
_pictureHeight = height;
|
|
||||||
_pictureWidth = width;
|
|
||||||
_pictureHeight = height;
|
|
||||||
EntityTank = new EntityTank(speed, weight, bodyColor, additionalColor);
|
|
||||||
|
|
||||||
if (_pictureWidth > _tankWidth && _pictureHeight > _tankHeight)
|
|
||||||
{
|
|
||||||
EntityTank = new EntityTank(speed, weight, bodyColor, additionalColor);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
EntityTank = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Проверка, что объект может переместится по указанному направлению
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="direction">Направление</param>
|
|
||||||
/// <returns>true - можно переместится по указанному направлению</returns>
|
|
||||||
public bool CanMove(DirectionType direction)
|
|
||||||
{
|
|
||||||
if (EntityTank == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return direction switch
|
|
||||||
{
|
|
||||||
//влево
|
|
||||||
DirectionType.Left => _startPosX - EntityTank.Step > 0,
|
|
||||||
//вверх
|
|
||||||
DirectionType.Up => _startPosY - EntityTank.Step > 0,
|
|
||||||
// вправо
|
|
||||||
DirectionType.Right => _startPosX + _tankWidth + EntityTank.Step < _pictureWidth,
|
|
||||||
//вниз
|
|
||||||
DirectionType.Down => _startPosY + _tankHeight + EntityTank.Step < _pictureHeight,
|
|
||||||
_ => false,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Изменение направления перемещения
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="direction">Направление</param>
|
|
||||||
public void MoveTransport(DirectionType direction)
|
|
||||||
{
|
|
||||||
if (!CanMove(direction) || EntityTank == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
switch (direction)
|
|
||||||
{
|
|
||||||
//влево
|
|
||||||
case DirectionType.Left:
|
|
||||||
_startPosX -= (int)EntityTank.Step;
|
|
||||||
break;
|
|
||||||
//вверх
|
|
||||||
case DirectionType.Up:
|
|
||||||
_startPosY -= (int)EntityTank.Step;
|
|
||||||
break;
|
|
||||||
// вправо
|
|
||||||
case DirectionType.Right:
|
|
||||||
_startPosX += (int)EntityTank.Step;
|
|
||||||
break;
|
|
||||||
//вниз
|
|
||||||
case DirectionType.Down:
|
|
||||||
_startPosY += (int)EntityTank.Step;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Установка позиции
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="x">Координата X</param>
|
|
||||||
/// <param name="y">Координата Y</param>
|
|
||||||
public void SetPosition(int x, int y)
|
|
||||||
{
|
|
||||||
if (EntityTank == null) return;
|
|
||||||
while (x + _tankWidth > _pictureWidth)
|
|
||||||
{
|
|
||||||
x -= (int)EntityTank.Step;
|
|
||||||
}
|
|
||||||
while (x < 0)
|
|
||||||
{
|
|
||||||
x += (int)EntityTank.Step;
|
|
||||||
}
|
|
||||||
while (y + _tankHeight > _pictureHeight)
|
|
||||||
{
|
|
||||||
y -= (int)EntityTank.Step;
|
|
||||||
}
|
|
||||||
while (y < 0)
|
|
||||||
{
|
|
||||||
y += (int)EntityTank.Step;
|
|
||||||
}
|
|
||||||
_startPosX = x;
|
|
||||||
_startPosY = y;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Прорисовка объекта
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="g"></param>
|
|
||||||
public virtual void DrawTransport(Graphics g)
|
|
||||||
{
|
|
||||||
if (EntityTank == null) { return; }
|
|
||||||
Pen pen = new(Color.Black);
|
|
||||||
pen.Width = 2;
|
|
||||||
Brush brush = new SolidBrush(EntityTank.BodyColor);
|
|
||||||
|
|
||||||
Random random = new Random();
|
|
||||||
Brush additionalBrush = new SolidBrush(EntityTank.AdditionalColor);
|
|
||||||
|
|
||||||
// границы зенитной установки
|
|
||||||
g.DrawRectangle(pen, _startPosX + 3, _startPosY + 60, 121, 23);
|
|
||||||
g.DrawRectangle(pen, _startPosX + 20, _startPosY + 43, 54, 16);
|
|
||||||
g.DrawRectangle(pen, _startPosX + 42, _startPosY + 33, 16, 9);
|
|
||||||
|
|
||||||
// корпус
|
|
||||||
g.FillRectangle(brush, _startPosX + 3, _startPosY + 60, 121, 23);
|
|
||||||
g.FillRectangle(brush, _startPosX + 20, _startPosY + 43, 54, 16);
|
|
||||||
g.FillRectangle(brush, _startPosX + 42, _startPosY + 33, 16, 9);
|
|
||||||
|
|
||||||
// контур гусеницы
|
|
||||||
g.DrawLine(pen, _startPosX + 13, _startPosY + 100, _startPosX + 114, _startPosY + 100);
|
|
||||||
g.DrawLine(pen, _startPosX + 6, _startPosY + 99, _startPosX + 16, _startPosY + 99);
|
|
||||||
g.DrawLine(pen, _startPosX + 4, _startPosY + 98, _startPosX + 6, _startPosY + 98);
|
|
||||||
g.DrawLine(pen, _startPosX + 4, _startPosY + 97, _startPosX + 4, _startPosY + 86);
|
|
||||||
g.DrawLine(pen, _startPosX + 4, _startPosY + 86, _startPosX + 5, _startPosY + 86);
|
|
||||||
g.DrawLine(pen, _startPosX + 5, _startPosY + 85, _startPosX + 10, _startPosY + 85);
|
|
||||||
g.DrawLine(pen, _startPosX + 10, _startPosY + 84, _startPosX + 116, _startPosY + 84);
|
|
||||||
g.DrawLine(pen, _startPosX + 116, _startPosY + 85, _startPosX + 123, _startPosY + 85);
|
|
||||||
g.DrawLine(pen, _startPosX + 124, _startPosY + 86, _startPosX + 125, _startPosY + 86);
|
|
||||||
g.DrawLine(pen, _startPosX + 125, _startPosY + 87, _startPosX + 125, _startPosY + 97);
|
|
||||||
g.DrawLine(pen, _startPosX + 123, _startPosY + 98, _startPosX + 125, _startPosY + 98);
|
|
||||||
g.DrawLine(pen, _startPosX + 115, _startPosY + 99, _startPosX + 123, _startPosY + 99);
|
|
||||||
|
|
||||||
//гусеница
|
|
||||||
g.FillRectangle(additionalBrush, _startPosX + 4, _startPosY + 87, 120, 10);
|
|
||||||
g.FillRectangle(additionalBrush, _startPosX + 19, _startPosY + 85, 92, 2);
|
|
||||||
g.FillRectangle(additionalBrush, _startPosX + 14, _startPosY + 93, 100, 7);
|
|
||||||
|
|
||||||
// контур колес
|
|
||||||
g.DrawEllipse(pen, _startPosX + 5, _startPosY + 83, 18, 17);
|
|
||||||
g.DrawEllipse(pen, _startPosX + 30, _startPosY + 88, 15, 12);
|
|
||||||
g.DrawEllipse(pen, _startPosX + 50, _startPosY + 88, 15, 12);
|
|
||||||
g.DrawEllipse(pen, _startPosX + 70, _startPosY + 88, 15, 12);
|
|
||||||
g.DrawEllipse(pen, _startPosX + 87, _startPosY + 88, 15, 12);
|
|
||||||
g.DrawEllipse(pen, _startPosX + 107, _startPosY + 83, 18, 17);
|
|
||||||
|
|
||||||
// контур верхних катков
|
|
||||||
g.DrawEllipse(pen, _startPosX + 43, _startPosY + 83, 7, 5);
|
|
||||||
g.DrawEllipse(pen, _startPosX + 64, _startPosY + 83, 7, 5);
|
|
||||||
g.DrawEllipse(pen, _startPosX + 82, _startPosY + 83, 7, 5);
|
|
||||||
|
|
||||||
|
|
||||||
// колеса
|
|
||||||
g.FillEllipse(brush, _startPosX + 5, _startPosY + 83, 18, 17);
|
|
||||||
g.FillEllipse(brush, _startPosX + 30, _startPosY + 88, 15, 12);
|
|
||||||
g.FillEllipse(brush, _startPosX + 50, _startPosY + 88, 15, 12);
|
|
||||||
g.FillEllipse(brush, _startPosX + 70, _startPosY + 88, 15, 12);
|
|
||||||
g.FillEllipse(brush, _startPosX + 87, _startPosY + 88, 15, 12);
|
|
||||||
g.FillEllipse(brush, _startPosX + 107, _startPosY + 83, 18, 17);
|
|
||||||
|
|
||||||
// верхние катки
|
|
||||||
g.FillEllipse(brush, _startPosX + 43, _startPosY + 83, 7, 5);
|
|
||||||
g.FillEllipse(brush, _startPosX + 64, _startPosY + 83, 7, 5);
|
|
||||||
g.FillEllipse(brush, _startPosX + 82, _startPosY + 83, 7, 5);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,47 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace ProjectAntiAircraftGun.Entities
|
|
||||||
{
|
|
||||||
public class EntityAntiAircraftGun : EntityTank
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Радар
|
|
||||||
/// </summary>
|
|
||||||
public bool Radar { get; private set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// люк зенитной установки
|
|
||||||
/// </summary>
|
|
||||||
public bool Hatch { get; private set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// пушка танк
|
|
||||||
/// </summary>
|
|
||||||
public bool Cannon { get; private set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Шаг перемещения зенитной установки
|
|
||||||
/// </summary>
|
|
||||||
public double Step => (double)Speed * 100 / Weight;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Инициализация полей объекта-класс зенитной установки
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="speed">Скорость</param>
|
|
||||||
/// <param name="weight">Вес зенитной установки</param>
|
|
||||||
/// <param name="bodyColor">Основной цвет</param>
|
|
||||||
/// <param name="radar">Признак наличия радара</param>
|
|
||||||
/// <param name="hatch">Признак наличия люка зенитной установки</param>
|
|
||||||
/// <param name="cannon">Признак наличия пушки зенитной установки</param>
|
|
||||||
public EntityAntiAircraftGun(int speed, double weight, Color bodyColor, Color additionalColor, bool radar, bool hatch, bool cannon) : base(speed, weight, bodyColor, additionalColor)
|
|
||||||
{
|
|
||||||
Hatch = hatch;
|
|
||||||
Radar = radar;
|
|
||||||
Cannon = cannon;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,45 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace ProjectAntiAircraftGun.Entities
|
|
||||||
{
|
|
||||||
public class EntityTank
|
|
||||||
{
|
|
||||||
/// <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 Color AdditionalColor { get; private set; }
|
|
||||||
/// <summary>
|
|
||||||
/// Шаг перемещения автомобиля
|
|
||||||
/// </summary>
|
|
||||||
public double Step => (double)Speed * 100 / Weight;
|
|
||||||
/// <summary>
|
|
||||||
/// Конструктор с параметрами
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="speed">Скорость</param>
|
|
||||||
/// <param name="weight">Вес автомобиля</param>
|
|
||||||
/// <param name="bodyColor">Основной цвет</param>
|
|
||||||
public EntityTank(int speed, double weight, Color bodyColor, Color additionalColor)
|
|
||||||
{
|
|
||||||
Speed = speed;
|
|
||||||
Weight = weight;
|
|
||||||
BodyColor = bodyColor;
|
|
||||||
AdditionalColor = additionalColor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
192
ProjectAntiAirCraftGun/FormAntiAircraftGun.Designer.cs
generated
@ -1,192 +0,0 @@
|
|||||||
namespace ProjectAntiAircraftGun
|
|
||||||
{
|
|
||||||
partial class FormAntiAircraftGun
|
|
||||||
{
|
|
||||||
/// <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()
|
|
||||||
{
|
|
||||||
pictureBoxAntiAircraftGun = new PictureBox();
|
|
||||||
buttonCreateAntiAircraftGun = new Button();
|
|
||||||
buttonRight = new Button();
|
|
||||||
buttonLeft = new Button();
|
|
||||||
buttonDown = new Button();
|
|
||||||
buttonUp = new Button();
|
|
||||||
comboBoxStrategy = new ComboBox();
|
|
||||||
buttonCreateTank = new Button();
|
|
||||||
buttonStep = new Button();
|
|
||||||
buttonUpdateCollection = new Button();
|
|
||||||
((System.ComponentModel.ISupportInitialize)pictureBoxAntiAircraftGun).BeginInit();
|
|
||||||
SuspendLayout();
|
|
||||||
//
|
|
||||||
// pictureBoxAntiAircraftGun
|
|
||||||
//
|
|
||||||
pictureBoxAntiAircraftGun.Dock = DockStyle.Fill;
|
|
||||||
pictureBoxAntiAircraftGun.Location = new Point(0, 0);
|
|
||||||
pictureBoxAntiAircraftGun.Name = "pictureBoxAntiAircraftGun";
|
|
||||||
pictureBoxAntiAircraftGun.Size = new Size(800, 450);
|
|
||||||
pictureBoxAntiAircraftGun.SizeMode = PictureBoxSizeMode.AutoSize;
|
|
||||||
pictureBoxAntiAircraftGun.TabIndex = 0;
|
|
||||||
pictureBoxAntiAircraftGun.TabStop = false;
|
|
||||||
//
|
|
||||||
// buttonCreateAntiAircraftGun
|
|
||||||
//
|
|
||||||
buttonCreateAntiAircraftGun.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
|
||||||
buttonCreateAntiAircraftGun.Location = new Point(12, 415);
|
|
||||||
buttonCreateAntiAircraftGun.Name = "buttonCreateAntiAircraftGun";
|
|
||||||
buttonCreateAntiAircraftGun.Size = new Size(174, 23);
|
|
||||||
buttonCreateAntiAircraftGun.TabIndex = 1;
|
|
||||||
buttonCreateAntiAircraftGun.Text = "создать зенитную установку";
|
|
||||||
buttonCreateAntiAircraftGun.UseVisualStyleBackColor = true;
|
|
||||||
buttonCreateAntiAircraftGun.Click += ButtonCreateAntiAircraftGun;
|
|
||||||
//
|
|
||||||
// buttonRight
|
|
||||||
//
|
|
||||||
buttonRight.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
|
||||||
buttonRight.BackgroundImage = Properties.Resources.png_transparent_grammatical_person_paper_narration_direzione_didattica_statale_gestione_scuola_elementare_copy_print_right_arrow_miscellaneous_game_angle;
|
|
||||||
buttonRight.BackgroundImageLayout = ImageLayout.Zoom;
|
|
||||||
buttonRight.Location = new Point(739, 413);
|
|
||||||
buttonRight.Name = "buttonRight";
|
|
||||||
buttonRight.Size = new Size(61, 30);
|
|
||||||
buttonRight.TabIndex = 2;
|
|
||||||
buttonRight.UseVisualStyleBackColor = true;
|
|
||||||
buttonRight.Click += ButtonMove_Click;
|
|
||||||
//
|
|
||||||
// buttonLeft
|
|
||||||
//
|
|
||||||
buttonLeft.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
|
||||||
buttonLeft.BackgroundImage = Properties.Resources.left;
|
|
||||||
buttonLeft.BackgroundImageLayout = ImageLayout.Zoom;
|
|
||||||
buttonLeft.Location = new Point(605, 413);
|
|
||||||
buttonLeft.Name = "buttonLeft";
|
|
||||||
buttonLeft.Size = new Size(61, 30);
|
|
||||||
buttonLeft.TabIndex = 6;
|
|
||||||
buttonLeft.UseVisualStyleBackColor = true;
|
|
||||||
buttonLeft.Click += ButtonMove_Click;
|
|
||||||
//
|
|
||||||
// buttonDown
|
|
||||||
//
|
|
||||||
buttonDown.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
|
||||||
buttonDown.BackgroundImage = Properties.Resources.bottom;
|
|
||||||
buttonDown.BackgroundImageLayout = ImageLayout.Zoom;
|
|
||||||
buttonDown.Location = new Point(672, 415);
|
|
||||||
buttonDown.Name = "buttonDown";
|
|
||||||
buttonDown.Size = new Size(61, 30);
|
|
||||||
buttonDown.TabIndex = 7;
|
|
||||||
buttonDown.UseVisualStyleBackColor = true;
|
|
||||||
buttonDown.Click += ButtonMove_Click;
|
|
||||||
//
|
|
||||||
// buttonUp
|
|
||||||
//
|
|
||||||
buttonUp.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
|
||||||
buttonUp.BackgroundImage = Properties.Resources.top;
|
|
||||||
buttonUp.BackgroundImageLayout = ImageLayout.Zoom;
|
|
||||||
buttonUp.Location = new Point(672, 379);
|
|
||||||
buttonUp.Name = "buttonUp";
|
|
||||||
buttonUp.Size = new Size(61, 30);
|
|
||||||
buttonUp.TabIndex = 8;
|
|
||||||
buttonUp.UseVisualStyleBackColor = true;
|
|
||||||
buttonUp.Click += ButtonMove_Click;
|
|
||||||
//
|
|
||||||
// comboBoxStrategy
|
|
||||||
//
|
|
||||||
comboBoxStrategy.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
|
||||||
comboBoxStrategy.DropDownStyle = ComboBoxStyle.DropDownList;
|
|
||||||
comboBoxStrategy.FormattingEnabled = true;
|
|
||||||
comboBoxStrategy.Items.AddRange(new object[] { "0", "1" });
|
|
||||||
comboBoxStrategy.Location = new Point(679, 0);
|
|
||||||
comboBoxStrategy.Name = "comboBoxStrategy";
|
|
||||||
comboBoxStrategy.Size = new Size(121, 23);
|
|
||||||
comboBoxStrategy.TabIndex = 9;
|
|
||||||
//
|
|
||||||
// buttonCreateTank
|
|
||||||
//
|
|
||||||
buttonCreateTank.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
|
||||||
buttonCreateTank.Location = new Point(192, 415);
|
|
||||||
buttonCreateTank.Name = "buttonCreateTank";
|
|
||||||
buttonCreateTank.Size = new Size(108, 23);
|
|
||||||
buttonCreateTank.TabIndex = 10;
|
|
||||||
buttonCreateTank.Text = "создать танк";
|
|
||||||
buttonCreateTank.UseVisualStyleBackColor = true;
|
|
||||||
buttonCreateTank.Click += ButtonCreateTank_Click;
|
|
||||||
//
|
|
||||||
// buttonStep
|
|
||||||
//
|
|
||||||
buttonStep.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
|
||||||
buttonStep.Location = new Point(704, 29);
|
|
||||||
buttonStep.Name = "buttonStep";
|
|
||||||
buttonStep.Size = new Size(75, 23);
|
|
||||||
buttonStep.TabIndex = 11;
|
|
||||||
buttonStep.Text = "шаг";
|
|
||||||
buttonStep.UseVisualStyleBackColor = true;
|
|
||||||
buttonStep.Click += ButtonStep_Click;
|
|
||||||
//
|
|
||||||
// buttonUpdateCollection
|
|
||||||
//
|
|
||||||
buttonUpdateCollection.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
|
|
||||||
buttonUpdateCollection.Location = new Point(306, 413);
|
|
||||||
buttonUpdateCollection.Name = "buttonUpdateCollection";
|
|
||||||
buttonUpdateCollection.Size = new Size(137, 23);
|
|
||||||
buttonUpdateCollection.TabIndex = 12;
|
|
||||||
buttonUpdateCollection.Text = "обновить коллекцию";
|
|
||||||
buttonUpdateCollection.UseVisualStyleBackColor = true;
|
|
||||||
buttonUpdateCollection.Click += ButtonSelectCar_Click;
|
|
||||||
//
|
|
||||||
// FormAntiAircraftGun
|
|
||||||
//
|
|
||||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
|
||||||
AutoScaleMode = AutoScaleMode.Font;
|
|
||||||
ClientSize = new Size(800, 450);
|
|
||||||
Controls.Add(buttonUpdateCollection);
|
|
||||||
Controls.Add(buttonStep);
|
|
||||||
Controls.Add(buttonCreateTank);
|
|
||||||
Controls.Add(comboBoxStrategy);
|
|
||||||
Controls.Add(buttonUp);
|
|
||||||
Controls.Add(buttonDown);
|
|
||||||
Controls.Add(buttonLeft);
|
|
||||||
Controls.Add(buttonRight);
|
|
||||||
Controls.Add(buttonCreateAntiAircraftGun);
|
|
||||||
Controls.Add(pictureBoxAntiAircraftGun);
|
|
||||||
Name = "FormAntiAircraftGun";
|
|
||||||
Text = "Зенитная установка";
|
|
||||||
((System.ComponentModel.ISupportInitialize)pictureBoxAntiAircraftGun).EndInit();
|
|
||||||
ResumeLayout(false);
|
|
||||||
PerformLayout();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
private PictureBox pictureBoxAntiAircraftGun;
|
|
||||||
private Button buttonCreateAntiAircraftGun;
|
|
||||||
private Button buttonRight;
|
|
||||||
private Button buttonLeft;
|
|
||||||
private Button buttonDown;
|
|
||||||
private Button buttonUp;
|
|
||||||
private Button buttonCreateTank;
|
|
||||||
private Button buttonStep;
|
|
||||||
private ComboBox comboBoxStrategy;
|
|
||||||
private Button buttonUpdateCollection;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,187 +0,0 @@
|
|||||||
using ProjectAntiAircraftGun.DrawingObjects;
|
|
||||||
using ProjectAntiAircraftGun.MovementStrategy;
|
|
||||||
using ProjectAntiAircraftGun.MovementStrategy;
|
|
||||||
|
|
||||||
namespace ProjectAntiAircraftGun
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Ôîðìà ðàáîòû ñ îáúåêòîì "Çåíèòíàÿ óñòàíîâêà"
|
|
||||||
/// </summary>
|
|
||||||
public partial class FormAntiAircraftGun : Form
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Ïîëå-îáúåêò äëÿ ïðîðèñîâêè îáúåêòà
|
|
||||||
/// </summary>
|
|
||||||
private DrawingTank? _drawingTank;
|
|
||||||
/// <summary>
|
|
||||||
/// Ñòðàòåãèÿ ïåðåìåùåíèÿ
|
|
||||||
/// </summary>
|
|
||||||
private AbstractStrategy? _abstractStrategy;
|
|
||||||
|
|
||||||
public DrawingTank? SelectedTank { get; private set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Èíèöèàëèçàöèÿ ôîðìû
|
|
||||||
/// </summary>
|
|
||||||
public FormAntiAircraftGun()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
_abstractStrategy = null;
|
|
||||||
SelectedTank = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Ìåòîä ïðîðèñîâêè çåíèòíîé óñòàíîâêè
|
|
||||||
/// </summary>
|
|
||||||
private void Draw()
|
|
||||||
{
|
|
||||||
if (_drawingTank == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Bitmap bmp = new(pictureBoxAntiAircraftGun.Width,
|
|
||||||
pictureBoxAntiAircraftGun.Height);
|
|
||||||
Graphics gr = Graphics.FromImage(bmp);
|
|
||||||
_drawingTank.DrawTransport(gr);
|
|
||||||
pictureBoxAntiAircraftGun.Image = bmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Îáðàáîòêà íàæàòèÿ êíîïêè "Ñîçäàòü òàíê"
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
private void ButtonCreateTank_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));
|
|
||||||
_drawingTank = new DrawingTank(random.Next(100, 300),
|
|
||||||
random.Next(1000, 3000),
|
|
||||||
color, dopColor,
|
|
||||||
pictureBoxAntiAircraftGun.Width, pictureBoxAntiAircraftGun.Height);
|
|
||||||
_drawingTank.SetPosition(random.Next(10, 100), random.Next(10,
|
|
||||||
100));
|
|
||||||
Draw();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Îáðàáîòêà íàæàòèÿ êíîïêè "Ñîçäàòü çåíèòíóþ óñòàíîâêó"
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
private void ButtonCreateAntiAircraftGun(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
ColorDialog dialogCoreColor = new ColorDialog();
|
|
||||||
|
|
||||||
Random random = new();
|
|
||||||
Color color = Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256));
|
|
||||||
if (dialogCoreColor.ShowDialog() == DialogResult.OK) { color = dialogCoreColor.Color; }
|
|
||||||
|
|
||||||
ColorDialog dialogSatelliteColor = new ColorDialog();
|
|
||||||
|
|
||||||
Color dopColor = Color.FromArgb(random.Next(0, 256),
|
|
||||||
random.Next(0, 256), random.Next(0, 256));
|
|
||||||
if (dialogSatelliteColor.ShowDialog() == DialogResult.OK) { dopColor = dialogSatelliteColor.Color; }
|
|
||||||
|
|
||||||
|
|
||||||
_drawingTank = new DrawingAntiAircraftGun(random.Next(100, 300),
|
|
||||||
random.Next(1000, 3000),color,dopColor,
|
|
||||||
Convert.ToBoolean(random.Next(0, 2)),
|
|
||||||
Convert.ToBoolean(random.Next(0, 2)), Convert.ToBoolean(random.Next(0, 2)),
|
|
||||||
pictureBoxAntiAircraftGun.Width, pictureBoxAntiAircraftGun.Height);
|
|
||||||
_drawingTank.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 (_drawingTank == null) return;
|
|
||||||
|
|
||||||
string name = ((Button)sender)?.Name ?? string.Empty;
|
|
||||||
switch (name)
|
|
||||||
{
|
|
||||||
case "buttonUp":
|
|
||||||
_drawingTank.MoveTransport(DirectionType.Up);
|
|
||||||
break;
|
|
||||||
case "buttonDown":
|
|
||||||
_drawingTank.MoveTransport(DirectionType.Down);
|
|
||||||
break;
|
|
||||||
case "buttonLeft":
|
|
||||||
_drawingTank.MoveTransport(DirectionType.Left);
|
|
||||||
break;
|
|
||||||
case "buttonRight":
|
|
||||||
_drawingTank.MoveTransport(DirectionType.Right);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
Draw();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Îáðàáîòêà íàæàòèÿ êíîïêè "Øàã"
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
private void ButtonStep_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (_drawingTank == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (comboBoxStrategy.Enabled)
|
|
||||||
{
|
|
||||||
_abstractStrategy = comboBoxStrategy.SelectedIndex
|
|
||||||
switch
|
|
||||||
{
|
|
||||||
0 => new MoveToCenter(),
|
|
||||||
1 => new MoveToBorder(),
|
|
||||||
_ => null,
|
|
||||||
};
|
|
||||||
if (_abstractStrategy == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
_abstractStrategy.SetData(new
|
|
||||||
DrawingObjectTank(_drawingTank), pictureBoxAntiAircraftGun.Width,
|
|
||||||
pictureBoxAntiAircraftGun.Height);
|
|
||||||
comboBoxStrategy.Enabled = false;
|
|
||||||
}
|
|
||||||
if (_abstractStrategy == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
_abstractStrategy.MakeStep();
|
|
||||||
Draw();
|
|
||||||
if (_abstractStrategy.GetStatus() == Status.Finish)
|
|
||||||
{
|
|
||||||
comboBoxStrategy.Enabled = true;
|
|
||||||
_abstractStrategy = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Âûáîð òàíêà
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
private void ButtonSelectCar_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
SelectedTank = _drawingTank;
|
|
||||||
DialogResult = DialogResult.OK;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,120 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<root>
|
|
||||||
<!--
|
|
||||||
Microsoft ResX Schema
|
|
||||||
|
|
||||||
Version 2.0
|
|
||||||
|
|
||||||
The primary goals of this format is to allow a simple XML format
|
|
||||||
that is mostly human readable. The generation and parsing of the
|
|
||||||
various data types are done through the TypeConverter classes
|
|
||||||
associated with the data types.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
... ado.net/XML headers & schema ...
|
|
||||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
|
||||||
<resheader name="version">2.0</resheader>
|
|
||||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
|
||||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
|
||||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
|
||||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
|
||||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
|
||||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
|
||||||
</data>
|
|
||||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
|
||||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
|
||||||
<comment>This is a comment</comment>
|
|
||||||
</data>
|
|
||||||
|
|
||||||
There are any number of "resheader" rows that contain simple
|
|
||||||
name/value pairs.
|
|
||||||
|
|
||||||
Each data row contains a name, and value. The row also contains a
|
|
||||||
type or mimetype. Type corresponds to a .NET class that support
|
|
||||||
text/value conversion through the TypeConverter architecture.
|
|
||||||
Classes that don't support this are serialized and stored with the
|
|
||||||
mimetype set.
|
|
||||||
|
|
||||||
The mimetype is used for serialized objects, and tells the
|
|
||||||
ResXResourceReader how to depersist the object. This is currently not
|
|
||||||
extensible. For a given mimetype the value must be set accordingly:
|
|
||||||
|
|
||||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
|
||||||
that the ResXResourceWriter will generate, however the reader can
|
|
||||||
read any of the formats listed below.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.binary.base64
|
|
||||||
value : The object must be serialized with
|
|
||||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.soap.base64
|
|
||||||
value : The object must be serialized with
|
|
||||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
|
||||||
value : The object must be serialized into a byte array
|
|
||||||
: using a System.ComponentModel.TypeConverter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
-->
|
|
||||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
|
||||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:choice maxOccurs="unbounded">
|
|
||||||
<xsd:element name="metadata">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
|
||||||
<xsd:attribute name="type" type="xsd:string" />
|
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
|
||||||
<xsd:attribute ref="xml:space" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="assembly">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:attribute name="alias" type="xsd:string" />
|
|
||||||
<xsd:attribute name="name" type="xsd:string" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="data">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
|
||||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
|
||||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
|
||||||
<xsd:attribute ref="xml:space" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="resheader">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
</xsd:choice>
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
</xsd:schema>
|
|
||||||
<resheader name="resmimetype">
|
|
||||||
<value>text/microsoft-resx</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="version">
|
|
||||||
<value>2.0</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="reader">
|
|
||||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="writer">
|
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</resheader>
|
|
||||||
</root>
|
|
123
ProjectAntiAirCraftGun/FormTankCollection.Designer.cs
generated
@ -1,123 +0,0 @@
|
|||||||
namespace ProjectAntiAircraftGun
|
|
||||||
{
|
|
||||||
partial class FormTankCollection
|
|
||||||
{
|
|
||||||
/// <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()
|
|
||||||
{
|
|
||||||
pictureBoxCollection = new PictureBox();
|
|
||||||
maskedTextBoxNumber = new MaskedTextBox();
|
|
||||||
groupBoxInstruments = new GroupBox();
|
|
||||||
buttonUpdateCollection = new Button();
|
|
||||||
buttonDeleteTank = new Button();
|
|
||||||
buttonAddTank = new Button();
|
|
||||||
((System.ComponentModel.ISupportInitialize)pictureBoxCollection).BeginInit();
|
|
||||||
groupBoxInstruments.SuspendLayout();
|
|
||||||
SuspendLayout();
|
|
||||||
//
|
|
||||||
// pictureBoxCollection
|
|
||||||
//
|
|
||||||
pictureBoxCollection.Location = new Point(0, 0);
|
|
||||||
pictureBoxCollection.Name = "pictureBoxCollection";
|
|
||||||
pictureBoxCollection.Size = new Size(647, 455);
|
|
||||||
pictureBoxCollection.TabIndex = 0;
|
|
||||||
pictureBoxCollection.TabStop = false;
|
|
||||||
//
|
|
||||||
// maskedTextBoxNumber
|
|
||||||
//
|
|
||||||
maskedTextBoxNumber.Location = new Point(24, 104);
|
|
||||||
maskedTextBoxNumber.Name = "maskedTextBoxNumber";
|
|
||||||
maskedTextBoxNumber.Size = new Size(100, 23);
|
|
||||||
maskedTextBoxNumber.TabIndex = 1;
|
|
||||||
//
|
|
||||||
// groupBoxInstruments
|
|
||||||
//
|
|
||||||
groupBoxInstruments.Controls.Add(buttonUpdateCollection);
|
|
||||||
groupBoxInstruments.Controls.Add(buttonDeleteTank);
|
|
||||||
groupBoxInstruments.Controls.Add(buttonAddTank);
|
|
||||||
groupBoxInstruments.Controls.Add(maskedTextBoxNumber);
|
|
||||||
groupBoxInstruments.Location = new Point(644, 0);
|
|
||||||
groupBoxInstruments.Name = "groupBoxInstruments";
|
|
||||||
groupBoxInstruments.Size = new Size(158, 455);
|
|
||||||
groupBoxInstruments.TabIndex = 2;
|
|
||||||
groupBoxInstruments.TabStop = false;
|
|
||||||
groupBoxInstruments.Text = "Инструменты";
|
|
||||||
//
|
|
||||||
// buttonUpdateCollection
|
|
||||||
//
|
|
||||||
buttonUpdateCollection.Location = new Point(24, 252);
|
|
||||||
buttonUpdateCollection.Name = "buttonUpdateCollection";
|
|
||||||
buttonUpdateCollection.Size = new Size(100, 23);
|
|
||||||
buttonUpdateCollection.TabIndex = 4;
|
|
||||||
buttonUpdateCollection.Text = "Обновить коллекцию";
|
|
||||||
buttonUpdateCollection.UseVisualStyleBackColor = true;
|
|
||||||
buttonUpdateCollection.Click += ButtonRefreshCollection_Click;
|
|
||||||
//
|
|
||||||
// buttonDeleteTank
|
|
||||||
//
|
|
||||||
buttonDeleteTank.Location = new Point(24, 182);
|
|
||||||
buttonDeleteTank.Name = "buttonDeleteTank";
|
|
||||||
buttonDeleteTank.Size = new Size(100, 23);
|
|
||||||
buttonDeleteTank.TabIndex = 3;
|
|
||||||
buttonDeleteTank.Text = "Удалить танк";
|
|
||||||
buttonDeleteTank.UseVisualStyleBackColor = true;
|
|
||||||
buttonDeleteTank.Click += ButtonRemoveTank_Click;
|
|
||||||
//
|
|
||||||
// buttonAddTank
|
|
||||||
//
|
|
||||||
buttonAddTank.Location = new Point(24, 52);
|
|
||||||
buttonAddTank.Name = "buttonAddTank";
|
|
||||||
buttonAddTank.Size = new Size(100, 23);
|
|
||||||
buttonAddTank.TabIndex = 2;
|
|
||||||
buttonAddTank.Text = "Добавить танк";
|
|
||||||
buttonAddTank.UseVisualStyleBackColor = true;
|
|
||||||
buttonAddTank.Click += ButtonAddTank_Click;
|
|
||||||
//
|
|
||||||
// FormTankCollection
|
|
||||||
//
|
|
||||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
|
||||||
AutoScaleMode = AutoScaleMode.Font;
|
|
||||||
ClientSize = new Size(800, 450);
|
|
||||||
Controls.Add(groupBoxInstruments);
|
|
||||||
Controls.Add(pictureBoxCollection);
|
|
||||||
Name = "FormTankCollection";
|
|
||||||
Text = "Набор танков";
|
|
||||||
((System.ComponentModel.ISupportInitialize)pictureBoxCollection).EndInit();
|
|
||||||
groupBoxInstruments.ResumeLayout(false);
|
|
||||||
groupBoxInstruments.PerformLayout();
|
|
||||||
ResumeLayout(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
private PictureBox pictureBoxCollection;
|
|
||||||
private MaskedTextBox maskedTextBoxNumber;
|
|
||||||
private GroupBox groupBoxInstruments;
|
|
||||||
private Button buttonUpdateCollection;
|
|
||||||
private Button buttonDeleteTank;
|
|
||||||
private Button buttonAddTank;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,83 +0,0 @@
|
|||||||
using ProjectAntiAircraftGun;
|
|
||||||
using ProjectAntiAircraftGun.DrawingObjects;
|
|
||||||
using ProjectAntiAircraftGun.Generics;
|
|
||||||
using ProjectAntiAircraftGun.MovementStrategy;
|
|
||||||
|
|
||||||
namespace ProjectAntiAircraftGun
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Форма для работы с набором объектов класса DrawningTank
|
|
||||||
/// </summary>
|
|
||||||
public partial class FormTankCollection : Form
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Набор объектов
|
|
||||||
/// </summary>
|
|
||||||
private readonly TanksGenericCollection<DrawingTank,
|
|
||||||
DrawingObjectTank> _tanks;
|
|
||||||
/// <summary>
|
|
||||||
/// Конструктор
|
|
||||||
/// </summary>
|
|
||||||
public FormTankCollection()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
_tanks = new TanksGenericCollection<DrawingTank, DrawingObjectTank>(pictureBoxCollection.Width, pictureBoxCollection.Height);
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Добавление объекта в набор
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
private void ButtonAddTank_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
FormAntiAircraftGun form = new();
|
|
||||||
|
|
||||||
if (form.ShowDialog() == DialogResult.OK)
|
|
||||||
{
|
|
||||||
if (_tanks + form.SelectedTank != -1)
|
|
||||||
{
|
|
||||||
MessageBox.Show("Объект добавлен");
|
|
||||||
pictureBoxCollection.Image = _tanks.ShowTanks();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MessageBox.Show("Не удалось добавить объект");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Удаление объекта из набора
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
private void ButtonRemoveTank_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (MessageBox.Show("Удалить объект?", "Удаление",
|
|
||||||
MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
int pos = Convert.ToInt32(maskedTextBoxNumber.Text);
|
|
||||||
if ((_tanks - pos))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Объект удален");
|
|
||||||
pictureBoxCollection.Image = _tanks.ShowTanks();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MessageBox.Show("Не удалось удалить объект");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Обновление рисунка по набору
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
private void ButtonRefreshCollection_Click(object sender, EventArgs
|
|
||||||
e)
|
|
||||||
{
|
|
||||||
pictureBoxCollection.Image = _tanks.ShowTanks();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,60 +0,0 @@
|
|||||||
<root>
|
|
||||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
|
||||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:choice maxOccurs="unbounded">
|
|
||||||
<xsd:element name="metadata">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
|
||||||
<xsd:attribute name="type" type="xsd:string" />
|
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
|
||||||
<xsd:attribute ref="xml:space" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="assembly">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:attribute name="alias" type="xsd:string" />
|
|
||||||
<xsd:attribute name="name" type="xsd:string" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="data">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
|
||||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
|
||||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
|
||||||
<xsd:attribute ref="xml:space" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="resheader">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
</xsd:choice>
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
</xsd:schema>
|
|
||||||
<resheader name="resmimetype">
|
|
||||||
<value>text/microsoft-resx</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="version">
|
|
||||||
<value>2.0</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="reader">
|
|
||||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="writer">
|
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</resheader>
|
|
||||||
</root>
|
|
@ -1,98 +0,0 @@
|
|||||||
using ProjectAntiAircraftGun.Entities;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace ProjectAntiAircraftGun.Generics
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Параметризованный набор объектов
|
|
||||||
/// </summary>
|
|
||||||
/// <typeparam name="T"></typeparam>
|
|
||||||
internal class SetGeneric<T>
|
|
||||||
where T : class
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Массив объектов, которые храним
|
|
||||||
/// </summary>
|
|
||||||
private readonly T?[] _places;
|
|
||||||
/// <summary>
|
|
||||||
/// Количество объектов в массиве
|
|
||||||
/// </summary>
|
|
||||||
public int Count => _places.Length;
|
|
||||||
/// <summary>
|
|
||||||
/// Конструктор
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="count"></param>
|
|
||||||
public SetGeneric(int count)
|
|
||||||
{
|
|
||||||
_places = new T?[count];
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Добавление объекта в набор
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="tank">Добавляемый танк</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public int Insert(T tank)
|
|
||||||
{
|
|
||||||
if (_places[0] == null)
|
|
||||||
{
|
|
||||||
_places[0] = tank;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
return Insert(tank, 0);
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Добавление объекта в набор на конкретную позицию
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="tank">Добавляемый танк</param>
|
|
||||||
/// <param name="position">Позиция</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public int Insert(T tank, int position)
|
|
||||||
{
|
|
||||||
if (position >= 0 && position < Count)
|
|
||||||
{
|
|
||||||
|
|
||||||
if (_places[position] == null)
|
|
||||||
{
|
|
||||||
_places[position] = tank;
|
|
||||||
return position;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (var i = Count - 1; i > position; --i)
|
|
||||||
{
|
|
||||||
_places[i] = _places[i - 1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_places[position] = tank;
|
|
||||||
return position;
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Удаление объекта из набора с конкретной позиции
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="position"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public bool Remove(int position)
|
|
||||||
{
|
|
||||||
|
|
||||||
if (position >= 0 && position < Count) _places[position] = null;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Получение объекта из набора по позиции
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="position"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public T? Get(int position)
|
|
||||||
{
|
|
||||||
if (position >= 0 && position < Count)
|
|
||||||
return _places[position];
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,145 +0,0 @@
|
|||||||
using ProjectAntiAircraftGun.DrawingObjects;
|
|
||||||
using ProjectAntiAircraftGun.Entities;
|
|
||||||
using ProjectAntiAircraftGun.MovementStrategy;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace ProjectAntiAircraftGun.Generics
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Параметризованный класс для набора объектов DrawningCar
|
|
||||||
/// </summary>
|
|
||||||
/// <typeparam name="T"></typeparam>
|
|
||||||
/// <typeparam name="U"></typeparam>
|
|
||||||
internal class TanksGenericCollection<T, U>
|
|
||||||
where T : DrawingTank
|
|
||||||
where U : IMoveableObject
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Ширина окна прорисовки
|
|
||||||
/// </summary>
|
|
||||||
private readonly int _pictureWidth;
|
|
||||||
/// <summary>
|
|
||||||
/// Высота окна прорисовки
|
|
||||||
/// </summary>
|
|
||||||
private readonly int _pictureHeight;
|
|
||||||
/// <summary>
|
|
||||||
/// Размер занимаемого объектом места (ширина)
|
|
||||||
/// </summary>
|
|
||||||
private readonly int _placeSizeWidth = 130;
|
|
||||||
/// <summary>
|
|
||||||
/// Размер занимаемого объектом места (высота)
|
|
||||||
/// </summary>
|
|
||||||
private readonly int _placeSizeHeight = 102;
|
|
||||||
/// <summary>
|
|
||||||
/// Набор объектов
|
|
||||||
/// </summary>
|
|
||||||
private readonly SetGeneric<T> _collection;
|
|
||||||
/// <summary>
|
|
||||||
/// Конструктор
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="picWidth"></param>
|
|
||||||
/// <param name="picHeight"></param>
|
|
||||||
public TanksGenericCollection(int picWidth, int picHeight)
|
|
||||||
{
|
|
||||||
int width = picWidth / _placeSizeWidth;
|
|
||||||
int height = picHeight / _placeSizeHeight;
|
|
||||||
_pictureWidth = picWidth;
|
|
||||||
_pictureHeight = picHeight;
|
|
||||||
_collection = new SetGeneric<T>(width * height);
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Перегрузка оператора сложения
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="collect"></param>
|
|
||||||
/// <param name="obj"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public static int operator +(TanksGenericCollection<T, U> collect, T? obj)
|
|
||||||
{
|
|
||||||
if (obj == null)
|
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
return collect._collection.Insert(obj);
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Перегрузка оператора вычитания
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="collect"></param>
|
|
||||||
/// <param name="pos"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public static bool operator -(TanksGenericCollection<T, U> collect, int
|
|
||||||
pos)
|
|
||||||
{
|
|
||||||
T? obj = collect._collection.Get(pos);
|
|
||||||
if (obj != null)
|
|
||||||
{
|
|
||||||
collect._collection.Remove(pos);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Получение объекта IMoveableObject
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="pos"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
public U? GetU(int pos)
|
|
||||||
{
|
|
||||||
return (U?)_collection.Get(pos)?.GetMoveableObject;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Вывод всего набора объектов
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
public Bitmap ShowTanks()
|
|
||||||
{
|
|
||||||
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>
|
|
||||||
/// Метод прорисовки объектов
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="g"></param>
|
|
||||||
private void DrawObjects(Graphics g)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < _collection.Count; i++)
|
|
||||||
{
|
|
||||||
T? tank = _collection.Get(i);
|
|
||||||
if (tank != null) {
|
|
||||||
int x = (i) % (_pictureWidth / _placeSizeWidth) * _placeSizeWidth;
|
|
||||||
int y = (i) / (_pictureHeight / _placeSizeHeight) * _placeSizeHeight;
|
|
||||||
tank.SetPosition(x, y);
|
|
||||||
tank.DrawTransport(g);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,131 +0,0 @@
|
|||||||
using ProjectAntiAircraftGun;
|
|
||||||
using static System.Windows.Forms.AxHost;
|
|
||||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
|
|
||||||
|
|
||||||
namespace ProjectAntiAircraftGun.MovementStrategy
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Класс-стратегия перемещения объекта
|
|
||||||
/// </summary>
|
|
||||||
public abstract class AbstractStrategy
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Перемещаемый объект
|
|
||||||
/// </summary>
|
|
||||||
private IMoveableObject? _moveableObject;
|
|
||||||
/// <summary>
|
|
||||||
/// Статус перемещения
|
|
||||||
/// </summary>
|
|
||||||
private Status _state = Status.NotInit;
|
|
||||||
/// <summary>
|
|
||||||
/// Ширина поля
|
|
||||||
/// </summary>
|
|
||||||
protected int FieldWidth { get; private set; }
|
|
||||||
/// <summary>
|
|
||||||
/// Высота поля
|
|
||||||
/// </summary>
|
|
||||||
protected int FieldHeight { get; private set; }
|
|
||||||
/// <summary>
|
|
||||||
/// Статус перемещения
|
|
||||||
/// </summary>
|
|
||||||
public Status GetStatus() { return _state; }
|
|
||||||
/// <summary>
|
|
||||||
/// Установка данных
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="moveableObject">Перемещаемый объект</param>
|
|
||||||
/// <param name="width">Ширина поля</param>
|
|
||||||
/// <param name="height">Высота поля</param>
|
|
||||||
public void SetData(IMoveableObject moveableObject, int width, int
|
|
||||||
height)
|
|
||||||
{
|
|
||||||
if (moveableObject == null)
|
|
||||||
{
|
|
||||||
_state = Status.NotInit;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
_state = Status.InProgress;
|
|
||||||
_moveableObject = moveableObject;
|
|
||||||
FieldWidth = width;
|
|
||||||
FieldHeight = height;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Шаг перемещения
|
|
||||||
/// </summary>
|
|
||||||
public void MakeStep()
|
|
||||||
{
|
|
||||||
if (_state != Status.InProgress)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (IsTargetDestination())
|
|
||||||
{
|
|
||||||
_state = Status.Finish;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
MoveToTarget();
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Перемещение влево
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>Результат перемещения (true - удалось переместиться, false - неудача)</ returns >
|
|
||||||
protected bool MoveLeft() => MoveTo(DirectionType.Left);
|
|
||||||
/// <summary>
|
|
||||||
/// Перемещение вправо
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>Результат перемещения (true - удалось переместиться, false - неудача)</ returns >
|
|
||||||
protected bool MoveRight() => MoveTo(DirectionType.Right);
|
|
||||||
/// <summary>
|
|
||||||
/// Перемещение вверх
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>Результат перемещения (true - удалось переместиться,false - неудача)</ returns >
|
|
||||||
protected bool MoveUp() => MoveTo(DirectionType.Up);
|
|
||||||
/// <summary>
|
|
||||||
/// Перемещение вниз
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>Результат перемещения (true - удалось переместиться, false - неудача)</ returns >
|
|
||||||
protected bool MoveDown() => MoveTo(DirectionType.Down);
|
|
||||||
/// <summary>
|
|
||||||
/// Параметры объекта
|
|
||||||
/// </summary>
|
|
||||||
protected ObjectParameters? GetObjectParameters => _moveableObject?.GetObjectPosition;
|
|
||||||
/// <summary>
|
|
||||||
/// Шаг объекта
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
protected int? GetStep()
|
|
||||||
{
|
|
||||||
if (_state != Status.InProgress)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return _moveableObject?.GetStep;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Перемещение к цели
|
|
||||||
/// </summary>
|
|
||||||
protected abstract void MoveToTarget();
|
|
||||||
/// <summary>
|
|
||||||
/// Достигнута ли цель
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
protected abstract bool IsTargetDestination();
|
|
||||||
/// <summary>
|
|
||||||
/// Попытка перемещения в требуемом направлении
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="directionType">Направление</param>
|
|
||||||
/// <returns>Результат попытки (true - удалось переместиться, false - неудача)</returns>
|
|
||||||
private bool MoveTo(DirectionType directionType)
|
|
||||||
{
|
|
||||||
if (_state != Status.InProgress)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (_moveableObject?.CheckCanMove(directionType) ?? false)
|
|
||||||
{
|
|
||||||
_moveableObject.MoveObject(directionType);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,32 +0,0 @@
|
|||||||
using ProjectAntiAircraftGun.DrawingObjects;
|
|
||||||
namespace ProjectAntiAircraftGun.MovementStrategy
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Реализация интерфейса IDrawningObject для работы с объектом Drawing (паттерн Adapter)
|
|
||||||
|
|
||||||
public class DrawingObjectTank : IMoveableObject
|
|
||||||
{
|
|
||||||
private readonly DrawingTank? _draningTank = null;
|
|
||||||
public DrawingObjectTank(DrawingTank drawingTank)
|
|
||||||
{
|
|
||||||
_draningTank = drawingTank;
|
|
||||||
}
|
|
||||||
public ObjectParameters? GetObjectPosition
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (_draningTank == null || _draningTank.EntityTank == null)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return new ObjectParameters(_draningTank.GetPosX,
|
|
||||||
_draningTank.GetPosY, _draningTank.GetWidth, _draningTank.GetHeight);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public int GetStep => (int)(_draningTank?.EntityTank?.Step ?? 0);
|
|
||||||
public bool CheckCanMove(DirectionType direction) =>
|
|
||||||
_draningTank?.CanMove(direction) ?? false;
|
|
||||||
public void MoveObject(DirectionType direction) =>
|
|
||||||
_draningTank?.MoveTransport(direction);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,29 +0,0 @@
|
|||||||
using ProjectAntiAircraftGun;
|
|
||||||
namespace ProjectAntiAircraftGun.MovementStrategy
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Интерфейс для работы с перемещаемым объектом
|
|
||||||
/// </summary>
|
|
||||||
public interface IMoveableObject
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Получение координаты X объекта
|
|
||||||
/// </summary>
|
|
||||||
ObjectParameters? GetObjectPosition { get; }
|
|
||||||
/// <summary>
|
|
||||||
/// Шаг объекта
|
|
||||||
/// </summary>
|
|
||||||
int GetStep { get; }
|
|
||||||
/// <summary>
|
|
||||||
/// Проверка, можно ли переместиться по нужному направлению
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="direction"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
bool CheckCanMove(DirectionType direction);
|
|
||||||
/// <summary>
|
|
||||||
/// Изменение направления пермещения объекта
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="direction">Направление</param>
|
|
||||||
void MoveObject(DirectionType direction);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,60 +0,0 @@
|
|||||||
using ProjectAntiAircraftGun.Entities;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace ProjectAntiAircraftGun.MovementStrategy
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Стратегия перемещения объекта к правому нижнему краю формы
|
|
||||||
/// </summary>
|
|
||||||
public class MoveToBorder : AbstractStrategy
|
|
||||||
{
|
|
||||||
protected override bool IsTargetDestination()
|
|
||||||
{
|
|
||||||
var objParams = GetObjectParameters;
|
|
||||||
if (objParams == null)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return objParams.RightBorder <= FieldWidth &&
|
|
||||||
objParams.RightBorder + GetStep() >= FieldWidth &&
|
|
||||||
objParams.DownBorder <= FieldHeight &&
|
|
||||||
objParams.DownBorder + GetStep() >= FieldHeight;
|
|
||||||
}
|
|
||||||
protected override void MoveToTarget()
|
|
||||||
{
|
|
||||||
var objParams = GetObjectParameters;
|
|
||||||
if (objParams == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var diffX = objParams.RightBorder - FieldWidth;
|
|
||||||
if (Math.Abs(diffX) > GetStep())
|
|
||||||
{
|
|
||||||
if (diffX > 0)
|
|
||||||
{
|
|
||||||
MoveLeft();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MoveRight();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var diffY = objParams.DownBorder - FieldHeight;
|
|
||||||
if (Math.Abs(diffY) > GetStep())
|
|
||||||
{
|
|
||||||
if (diffY > 0)
|
|
||||||
{
|
|
||||||
MoveUp();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MoveDown();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,60 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace ProjectAntiAircraftGun.MovementStrategy
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Стратегия перемещения объекта в центр экрана
|
|
||||||
/// </summary>
|
|
||||||
public class MoveToCenter : AbstractStrategy
|
|
||||||
{
|
|
||||||
protected override bool IsTargetDestination()
|
|
||||||
{
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,51 +0,0 @@
|
|||||||
namespace ProjectAntiAircraftGun.MovementStrategy
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Параметры-координаты объекта
|
|
||||||
/// </summary>
|
|
||||||
public class ObjectParameters
|
|
||||||
{
|
|
||||||
private readonly int _x;
|
|
||||||
private readonly int _y;
|
|
||||||
private readonly int _width;
|
|
||||||
private readonly int _height;
|
|
||||||
/// <summary>
|
|
||||||
/// Левая граница
|
|
||||||
/// </summary>
|
|
||||||
public int LeftBorder => _x;
|
|
||||||
/// <summary>
|
|
||||||
/// Верхняя граница
|
|
||||||
/// </summary>
|
|
||||||
public int TopBorder => _y;
|
|
||||||
/// <summary>
|
|
||||||
/// Правая граница
|
|
||||||
/// </summary>
|
|
||||||
public int RightBorder => _x + _width;
|
|
||||||
/// <summary>
|
|
||||||
/// Нижняя граница
|
|
||||||
/// </summary>
|
|
||||||
public int DownBorder => _y + _height;
|
|
||||||
/// <summary>
|
|
||||||
/// Середина объекта
|
|
||||||
/// </summary>
|
|
||||||
public int ObjectMiddleHorizontal => _x + _width / 2;
|
|
||||||
/// <summary>
|
|
||||||
/// Середина объекта
|
|
||||||
/// </summary>
|
|
||||||
public int ObjectMiddleVertical => _y + _height / 2;
|
|
||||||
/// <summary>
|
|
||||||
/// Конструктор
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="x">Координата X</param>
|
|
||||||
/// <param name="y">Координата Y</param>
|
|
||||||
/// <param name="width">Ширина</param>
|
|
||||||
/// <param name="height">Высота</param>
|
|
||||||
public ObjectParameters(int x, int y, int width, int height)
|
|
||||||
{
|
|
||||||
_x = x;
|
|
||||||
_y = y;
|
|
||||||
_width = width;
|
|
||||||
_height = height;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
namespace ProjectAntiAircraftGun.MovementStrategy
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Статус выполнения операции перемещения
|
|
||||||
/// </summary>
|
|
||||||
public enum Status
|
|
||||||
{
|
|
||||||
NotInit,
|
|
||||||
InProgress,
|
|
||||||
Finish
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
namespace ProjectAntiAircraftGun
|
|
||||||
{
|
|
||||||
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 FormTankCollection());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,26 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<OutputType>WinExe</OutputType>
|
|
||||||
<TargetFramework>net6.0-windows</TargetFramework>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
<UseWindowsForms>true</UseWindowsForms>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<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>
|
|
@ -1,25 +0,0 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
|
||||||
# Visual Studio Version 17
|
|
||||||
VisualStudioVersion = 17.5.33530.505
|
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProjectAntiAircraftGun", "ProjectAntiAircraftGun.csproj", "{3D00CFC0-D6DA-4872-B170-5D543632BC67}"
|
|
||||||
EndProject
|
|
||||||
Global
|
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
||||||
Debug|Any CPU = Debug|Any CPU
|
|
||||||
Release|Any CPU = Release|Any CPU
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
|
||||||
{3D00CFC0-D6DA-4872-B170-5D543632BC67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{3D00CFC0-D6DA-4872-B170-5D543632BC67}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{3D00CFC0-D6DA-4872-B170-5D543632BC67}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{3D00CFC0-D6DA-4872-B170-5D543632BC67}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
|
||||||
HideSolutionNode = FALSE
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
|
||||||
SolutionGuid = {0F97A468-ED8E-4382-904C-8D6C96065D61}
|
|
||||||
EndGlobalSection
|
|
||||||
EndGlobal
|
|
145
ProjectAntiAirCraftGun/Properties/Resources.Designer.cs
generated
@ -1,145 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <auto-generated>
|
|
||||||
// Этот код создан программой.
|
|
||||||
// Исполняемая версия:4.0.30319.42000
|
|
||||||
//
|
|
||||||
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
|
|
||||||
// повторной генерации кода.
|
|
||||||
// </auto-generated>
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
namespace ProjectAntiAircraftGun.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("ProjectAntiAircraftGun.Properties.Resources", typeof(Resources).Assembly);
|
|
||||||
resourceMan = temp;
|
|
||||||
}
|
|
||||||
return resourceMan;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Перезаписывает свойство CurrentUICulture текущего потока для всех
|
|
||||||
/// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией.
|
|
||||||
/// </summary>
|
|
||||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
|
||||||
internal static global::System.Globalization.CultureInfo Culture {
|
|
||||||
get {
|
|
||||||
return resourceCulture;
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
resourceCulture = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
|
||||||
/// </summary>
|
|
||||||
internal static System.Drawing.Bitmap bottom {
|
|
||||||
get {
|
|
||||||
object obj = ResourceManager.GetObject("bottom", resourceCulture);
|
|
||||||
return ((System.Drawing.Bitmap)(obj));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
|
||||||
/// </summary>
|
|
||||||
internal static System.Drawing.Bitmap left {
|
|
||||||
get {
|
|
||||||
object obj = ResourceManager.GetObject("left", resourceCulture);
|
|
||||||
return ((System.Drawing.Bitmap)(obj));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
|
||||||
/// </summary>
|
|
||||||
internal static System.Drawing.Bitmap png_clipart_computer_icons_uma_musume_pretty_derby_fate_grand_order_saber_kemono_friends_three_arrow_game_angle {
|
|
||||||
get {
|
|
||||||
object obj = ResourceManager.GetObject("png-clipart-computer-icons-uma-musume-pretty-derby-fate-grand-order-saber-kemono-" +
|
|
||||||
"friends-three-arrow-game-angle", resourceCulture);
|
|
||||||
return ((System.Drawing.Bitmap)(obj));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
|
||||||
/// </summary>
|
|
||||||
internal static System.Drawing.Bitmap png_transparent_arrow_arrow_cdr_angle_triangle {
|
|
||||||
get {
|
|
||||||
object obj = ResourceManager.GetObject("png-transparent-arrow-arrow-cdr-angle-triangle", resourceCulture);
|
|
||||||
return ((System.Drawing.Bitmap)(obj));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
|
||||||
/// </summary>
|
|
||||||
internal static System.Drawing.Bitmap png_transparent_arrow_left_thin_zondicons_icon {
|
|
||||||
get {
|
|
||||||
object obj = ResourceManager.GetObject("png-transparent-arrow-left-thin-zondicons-icon", resourceCulture);
|
|
||||||
return ((System.Drawing.Bitmap)(obj));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
|
||||||
/// </summary>
|
|
||||||
internal static System.Drawing.Bitmap png_transparent_grammatical_person_paper_narration_direzione_didattica_statale_gestione_scuola_elementare_copy_print_right_arrow_miscellaneous_game_angle {
|
|
||||||
get {
|
|
||||||
object obj = ResourceManager.GetObject("png-transparent-grammatical-person-paper-narration-direzione-didattica-statale-ge" +
|
|
||||||
"stione-scuola-elementare-copy-print-right-arrow-miscellaneous-game-angle", resourceCulture);
|
|
||||||
return ((System.Drawing.Bitmap)(obj));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
|
||||||
/// </summary>
|
|
||||||
internal static System.Drawing.Bitmap right {
|
|
||||||
get {
|
|
||||||
object obj = ResourceManager.GetObject("right", resourceCulture);
|
|
||||||
return ((System.Drawing.Bitmap)(obj));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
|
||||||
/// </summary>
|
|
||||||
internal static System.Drawing.Bitmap top {
|
|
||||||
get {
|
|
||||||
object obj = ResourceManager.GetObject("top", resourceCulture);
|
|
||||||
return ((System.Drawing.Bitmap)(obj));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,145 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<root>
|
|
||||||
<!--
|
|
||||||
Microsoft ResX Schema
|
|
||||||
|
|
||||||
Version 2.0
|
|
||||||
|
|
||||||
The primary goals of this format is to allow a simple XML format
|
|
||||||
that is mostly human readable. The generation and parsing of the
|
|
||||||
various data types are done through the TypeConverter classes
|
|
||||||
associated with the data types.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
... ado.net/XML headers & schema ...
|
|
||||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
|
||||||
<resheader name="version">2.0</resheader>
|
|
||||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
|
||||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
|
||||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
|
||||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
|
||||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
|
||||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
|
||||||
</data>
|
|
||||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
|
||||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
|
||||||
<comment>This is a comment</comment>
|
|
||||||
</data>
|
|
||||||
|
|
||||||
There are any number of "resheader" rows that contain simple
|
|
||||||
name/value pairs.
|
|
||||||
|
|
||||||
Each data row contains a name, and value. The row also contains a
|
|
||||||
type or mimetype. Type corresponds to a .NET class that support
|
|
||||||
text/value conversion through the TypeConverter architecture.
|
|
||||||
Classes that don't support this are serialized and stored with the
|
|
||||||
mimetype set.
|
|
||||||
|
|
||||||
The mimetype is used for serialized objects, and tells the
|
|
||||||
ResXResourceReader how to depersist the object. This is currently not
|
|
||||||
extensible. For a given mimetype the value must be set accordingly:
|
|
||||||
|
|
||||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
|
||||||
that the ResXResourceWriter will generate, however the reader can
|
|
||||||
read any of the formats listed below.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.binary.base64
|
|
||||||
value : The object must be serialized with
|
|
||||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.soap.base64
|
|
||||||
value : The object must be serialized with
|
|
||||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
|
||||||
value : The object must be serialized into a byte array
|
|
||||||
: using a System.ComponentModel.TypeConverter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
-->
|
|
||||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
|
||||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:choice maxOccurs="unbounded">
|
|
||||||
<xsd:element name="metadata">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
|
||||||
<xsd:attribute name="type" type="xsd:string" />
|
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
|
||||||
<xsd:attribute ref="xml:space" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="assembly">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:attribute name="alias" type="xsd:string" />
|
|
||||||
<xsd:attribute name="name" type="xsd:string" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="data">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
|
||||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
|
||||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
|
||||||
<xsd:attribute ref="xml:space" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="resheader">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
</xsd:choice>
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
</xsd:schema>
|
|
||||||
<resheader name="resmimetype">
|
|
||||||
<value>text/microsoft-resx</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="version">
|
|
||||||
<value>2.0</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="reader">
|
|
||||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="writer">
|
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</resheader>
|
|
||||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
|
||||||
<data name="png-transparent-arrow-arrow-cdr-angle-triangle" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
|
||||||
<value>..\Resources\png-transparent-arrow-arrow-cdr-angle-triangle.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
|
||||||
</data>
|
|
||||||
<data name="png-clipart-computer-icons-uma-musume-pretty-derby-fate-grand-order-saber-kemono-friends-three-arrow-game-angle" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
|
||||||
<value>..\Resources\png-clipart-computer-icons-uma-musume-pretty-derby-fate-grand-order-saber-kemono-friends-three-arrow-game-angle.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
|
||||||
</data>
|
|
||||||
<data name="png-transparent-grammatical-person-paper-narration-direzione-didattica-statale-gestione-scuola-elementare-copy-print-right-arrow-miscellaneous-game-angle" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
|
||||||
<value>..\Resources\png-transparent-grammatical-person-paper-narration-direzione-didattica-statale-gestione-scuola-elementare-copy-print-right-arrow-miscellaneous-game-angle.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
|
||||||
</data>
|
|
||||||
<data name="png-transparent-arrow-left-thin-zondicons-icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
|
||||||
<value>..\Resources\png-transparent-arrow-left-thin-zondicons-icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
|
||||||
</data>
|
|
||||||
<data name="bottom" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
|
||||||
<value>..\Resources\bottom.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
|
||||||
</data>
|
|
||||||
<data name="left" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
|
||||||
<value>..\Resources\left.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
|
||||||
</data>
|
|
||||||
<data name="right" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
|
||||||
<value>..\Resources\right.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
|
||||||
</data>
|
|
||||||
<data name="top" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
|
||||||
<value>..\Resources\top.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
|
||||||
</data>
|
|
||||||
</root>
|
|
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 3.1 KiB |