Лабораторная работа №1

This commit is contained in:
Petek1234 2024-02-21 11:59:49 +04:00
parent d725a33bf2
commit 59db2e2cdf
17 changed files with 982 additions and 51 deletions

View File

@ -0,0 +1,27 @@
namespace laba_0;
/// <summary>
/// направление перемещения
/// </summary>
public enum DirectionType
{
/// <summary>
/// вверх
/// </summary>
Up=1,
/// <summary>
/// вниз
/// </summary>
Down=2,
/// <summary>
/// влево
/// </summary>
Left=3,
/// <summary>
/// вправо
/// </summary>
Right=4
}

View File

@ -0,0 +1,212 @@
namespace laba_0;
/// <summary>
/// класс, отвечающий за прорисовку и перемещение объекта-сущности
/// </summary>
public class DrawningBoat
{
/// <summary>
/// класс-сущность
/// </summary>
public EntityBoat? EntityBoat { get; private set; }
/// <summary>
/// ширина окна
/// </summary>
private int? _pictureWidth;
/// <summary>
/// высота окна
/// </summary>
private int? _pictureHeight;
/// <summary>
/// левая координата прорисовки катера
/// </summary>
private int? _startPosX;
/// <summary>
/// верхняя координата прорисовки катера
/// </summary>
private int? _startPosY;
/// <summary>
/// ширина прорисовки катера
/// </summary>
private readonly int _drawningBoatWidth = 115;
/// <summary>
/// высота прорисовки катера
/// </summary>
private readonly int _drawningBoatHeight = 40;
/// <summary>
/// Инициализация свойств
/// </summary>
/// <param name="speed">Скорость</param>
/// <param name="weight">Вес</param>
/// <param name="bodyColor">Основной цвет</param>
/// <param name="additionalColor">Дополнительный цвет</param>
/// <param name="kabina">Признак наличия кабины</param>
/// <param name="dvigatel">Признак наличия двигателя</param>
public void Init(int speed, double weight, Color bodyColor, Color
additionalColor, bool kabina, bool dvigatel)
{
EntityBoat = new EntityBoat();
EntityBoat.Init(speed, weight, bodyColor, additionalColor,
kabina, dvigatel);
_pictureWidth = null;
_pictureHeight = null;
_startPosX = null;
_startPosY = null;
}
/// <summary>
/// Установка границ поля
/// </summary>
/// <param name="width">Ширина поля</param>
/// <param name="height">Высота поля</param>
/// <returns>true - границы заданы, false - проверка не пройдена, нельзя разместить объект в этих размерах</returns>
public bool SetPictureSize(int width, int height)
{
// TODO проверка, что объект "влезает" в размеры поля
if (_drawningBoatWidth < width && _drawningBoatHeight < height)
{
_pictureWidth = width;
_pictureHeight = height;
return true;
}
else
return false;
}
/// <summary>
/// Установка позиции
/// </summary>
/// <param name="x">Координата X</param>
/// <param name="y">Координата Y</param>
public void SetPosition(int x, int y)
{
if (!_pictureHeight.HasValue || !_pictureWidth.HasValue)
{
return;
}
if (x > 0 && y > 0 && x + _drawningBoatWidth < _pictureWidth && y + _drawningBoatHeight < _pictureHeight)
{
_startPosX = x;
_startPosY = y;
}
else
{
Random rnd = new Random();
_startPosX = rnd.Next(0, _pictureWidth.Value - _drawningBoatWidth);
_startPosY = rnd.Next(0, _pictureHeight.Value - _drawningBoatHeight);
}
}
/// <summary>
/// Изменение направления перемещения
/// </summary>
/// <param name="direction">Направление</param>
/// <returns>true - перемещение выполнено, false - перемещение невозможно</returns>
public bool MoveTransport(DirectionType direction)
{
if (EntityBoat == null || !_startPosX.HasValue ||
!_startPosY.HasValue)
{
return false;
}
switch (direction)
{
//влево
case DirectionType.Left:
if (_startPosX.Value - EntityBoat.Step > 0)
{
_startPosX -= (int)EntityBoat.Step;
}
return true;
//вверх
case DirectionType.Up:
if (_startPosY.Value - EntityBoat.Step > 0)
{
_startPosY -= (int)EntityBoat.Step;
}
return true;
// вправо
case DirectionType.Right:
if (_startPosX.Value + EntityBoat.Step + _drawningBoatWidth < _pictureWidth)
{
_startPosX += (int)EntityBoat.Step;
}
return true;
//вниз
case DirectionType.Down:
if (_startPosY.Value + EntityBoat.Step + _drawningBoatHeight < _pictureHeight)
{
_startPosY += (int)EntityBoat.Step;
}
return true;
default:
return false;
}
}
/// <summary>
/// Прорисовка объекта
/// </summary>
/// <param name="g"></param>
public void DrawTransport(Graphics g)
{
if (EntityBoat == null || !_startPosX.HasValue ||
!_startPosY.HasValue)
{
return;
}
Pen pen = new(Color.Black);
Brush additionalBrush = new SolidBrush(EntityBoat.AdditionalColor);
Brush bodyBrush = new SolidBrush(EntityBoat.BodyColor);
//корпус
g.FillRectangle(bodyBrush, _startPosX.Value + 5, _startPosY.Value , 75, 40);
g.DrawRectangle(pen, _startPosX.Value + 5, _startPosY.Value, 75, 40);
//лестница
g.FillRectangle(additionalBrush, _startPosX.Value + 5, _startPosY.Value + 10, 20, 20);
g.DrawRectangle(pen, _startPosX.Value + 5, _startPosY.Value + 10, 20, 20);
//двигатель
if (EntityBoat.dvigatelBody)
{
g.FillRectangle(additionalBrush, _startPosX.Value, _startPosY.Value + 15, 5, 10);
g.DrawRectangle(pen, _startPosX.Value, _startPosY.Value + 15, 5, 10);
}
//корма
Point point1 = new Point(_startPosX.Value + 80, _startPosY.Value);
Point point2 = new Point(_startPosX.Value + 80, _startPosY.Value+40);
Point point3 = new Point(_startPosX.Value + 120, _startPosY.Value + 20);
Point[] curvePointsKorma = { point1, point2, point3 };
g.DrawPolygon(pen, curvePointsKorma);
g.FillPolygon(bodyBrush, curvePointsKorma);
//кабина
if (EntityBoat.kabinaBody)
{
Point point4 = new Point(_startPosX.Value + 50, _startPosY.Value + 10);
Point point5 = new Point(_startPosX.Value + 55, _startPosY.Value + 15);
Point point6 = new Point(_startPosX.Value + 55, _startPosY.Value + 25);
Point point7 = new Point(_startPosX.Value + 50, _startPosY.Value + 30);
Point point8 = new Point(_startPosX.Value + 50, _startPosY.Value + 10);
Point[] curvePointsKabina = { point4, point5, point6, point7, point8 };
g.FillPolygon(additionalBrush, curvePointsKabina);
g.DrawPolygon(pen, curvePointsKabina);
}
}
}

View File

@ -0,0 +1,59 @@
namespace laba_0;
public class EntityBoat
{
/// <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 bool kabinaBody { get; private set; }
/// <summary>
/// Признак (опция) наличия антикрыла
/// </summary>
public bool dvigatelBody { get; private set; }
/// <summary>
/// Шаг перемещения автомобиля
/// </summary>
public double Step => Speed * 100 / Weight;
/// <summary>
///
/// </summary>
/// <param name="speed">Скорость</param>
/// <param name="weight">Вес</param>
/// <param name="bodyColor">Основной цвет</param>
/// <param name="additionalColor">Дополнительный цвет</param>
/// <param name="kabinaBody">Признак наличия кабины</param>
/// <param name="dvigatelBody">Признак наличия двигателя</param>
public void Init(int speed, double weight, Color bodyColor, Color additionalColor, bool kabina, bool dvigatel)
{
Speed = speed;
Weight = weight;
BodyColor = bodyColor;
AdditionalColor = additionalColor;
kabinaBody = kabina;
dvigatelBody = dvigatel;
}
}

View File

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

View File

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

138
laba 0/laba 0/FormBoat.Designer.cs generated Normal file
View File

@ -0,0 +1,138 @@
namespace laba_0;
partial class FormBoat
{
/// <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(FormBoat));
pictureBoxBoat = new PictureBox();
buttonCreate = new Button();
buttonRight = new Button();
buttonDown = new Button();
buttonUp = new Button();
buttonLeft = new Button();
((System.ComponentModel.ISupportInitialize)pictureBoxBoat).BeginInit();
SuspendLayout();
//
// pictureBoxBoat
//
pictureBoxBoat.BackgroundImageLayout = ImageLayout.Zoom;
pictureBoxBoat.Dock = DockStyle.Fill;
pictureBoxBoat.Location = new Point(0, 0);
pictureBoxBoat.Name = "pictureBoxBoat";
pictureBoxBoat.Size = new Size(640, 359);
pictureBoxBoat.SizeMode = PictureBoxSizeMode.AutoSize;
pictureBoxBoat.TabIndex = 0;
pictureBoxBoat.TabStop = false;
pictureBoxBoat.Click += ButtonMove_Click;
//
// buttonCreate
//
buttonCreate.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
buttonCreate.Location = new Point(12, 327);
buttonCreate.Name = "buttonCreate";
buttonCreate.Size = new Size(75, 23);
buttonCreate.TabIndex = 1;
buttonCreate.Text = "Создать ";
buttonCreate.UseVisualStyleBackColor = true;
buttonCreate.Click += ButtonCreateBoat_Click;
//
// buttonRight
//
buttonRight.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
buttonRight.BackgroundImage = (Image)resources.GetObject("buttonRight.BackgroundImage");
buttonRight.BackgroundImageLayout = ImageLayout.Zoom;
buttonRight.Location = new Point(593, 315);
buttonRight.Name = "buttonRight";
buttonRight.Size = new Size(35, 35);
buttonRight.TabIndex = 5;
buttonRight.UseVisualStyleBackColor = true;
buttonRight.Click += ButtonMove_Click;
//
// buttonDown
//
buttonDown.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
buttonDown.BackgroundImage = Properties.Resources.вниз1;
buttonDown.BackgroundImageLayout = ImageLayout.Zoom;
buttonDown.Location = new Point(552, 315);
buttonDown.Name = "buttonDown";
buttonDown.Size = new Size(35, 35);
buttonDown.TabIndex = 4;
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(552, 274);
buttonUp.Name = "buttonUp";
buttonUp.Size = new Size(35, 35);
buttonUp.TabIndex = 2;
buttonUp.UseVisualStyleBackColor = true;
buttonUp.Click += ButtonMove_Click;
//
// buttonLeft
//
buttonLeft.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
buttonLeft.BackgroundImage = Properties.Resources.влево;
buttonLeft.BackgroundImageLayout = ImageLayout.Zoom;
buttonLeft.Location = new Point(511, 315);
buttonLeft.Name = "buttonLeft";
buttonLeft.Size = new Size(35, 35);
buttonLeft.TabIndex = 3;
buttonLeft.UseVisualStyleBackColor = true;
buttonLeft.Click += ButtonMove_Click;
//
// FormBoat
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(640, 359);
Controls.Add(buttonRight);
Controls.Add(buttonDown);
Controls.Add(buttonLeft);
Controls.Add(buttonUp);
Controls.Add(buttonCreate);
Controls.Add(pictureBoxBoat);
Name = "FormBoat";
Text = "FormBoat";
((System.ComponentModel.ISupportInitialize)pictureBoxBoat).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion
private PictureBox pictureBoxBoat;
private Button buttonCreate;
private Button buttonRight;
private Button buttonDown;
private Button buttonUp;
private Button buttonLeft;
}

77
laba 0/laba 0/FormBoat.cs Normal file
View File

@ -0,0 +1,77 @@
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 laba_0;
public partial class FormBoat : Form
{
private DrawningBoat? _drawningBoat;
public FormBoat()
{
InitializeComponent();
}
private void Draw()
{
if (_drawningBoat == null)
{
return;
}
Bitmap bmp = new(pictureBoxBoat.Width,
pictureBoxBoat.Height);
Graphics gr = Graphics.FromImage(bmp);
_drawningBoat.DrawTransport(gr);
pictureBoxBoat.Image = bmp;
}
private void ButtonCreateBoat_Click(object sender, EventArgs e)
{
Random random = new();
_drawningBoat = new DrawningBoat();
_drawningBoat.Init(random.Next(650, 700), random.Next(15760, 16130),
Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)), Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256)),
Convert.ToBoolean(random.Next(0, 2)),
Convert.ToBoolean(random.Next(0, 2)));
_drawningBoat.SetPictureSize(pictureBoxBoat.Width, pictureBoxBoat.Height);
_drawningBoat.SetPosition(random.Next(10, 100), random.Next(10, 100));
Draw();
}
private void ButtonMove_Click(object sender, EventArgs e)
{
if (_drawningBoat == null)
{
return;
}
string name = ((Button)sender)?.Name ?? string.Empty;
bool result = false;
switch (name)
{
case "buttonUp":
result = _drawningBoat.MoveTransport(DirectionType.Up);
break;
case "buttonDown":
result = _drawningBoat.MoveTransport(DirectionType.Down);
break;
case "buttonLeft":
result = _drawningBoat.MoveTransport(DirectionType.Left);
break;
case "buttonRight":
result = _drawningBoat.MoveTransport(DirectionType.Right);
break;
}
if (result)
{
Draw();
}
}
}

203
laba 0/laba 0/FormBoat.resx Normal file
View File

@ -0,0 +1,203 @@
<?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="buttonRight.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAYAAAA+s9J6AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
vwAADr8BOAVTJ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Xwob
Rzw4xN4ddQ64xMYSDxCxZ/2G3BkC6Ox+/vx5QF2/ffsWvsh7doStaGvYPf8Lotzd3YUv9F6d5RL0GEIo
zu3tbfhi79He7ogvBSEUZ5QQjr4McQpCKM4IIfSvpp9pDriEEIrTewhnnAMuIYTi9BzCjMNZMiCE4vQa
wqzDWTIghOL0GMIZtqKtgRCK01sIFeaASwihOD2FsIfDWTIghOL0EsJeDmfJgBCK00MIFS9BjyGE4mSH
cNataGsghOJkhnDmrWhrIITiZIWw18NZMiCE4mSEUH0OuIQQitM6hL0fzpIBIRSnZQiVtqKtgRCK0yqE
oxzOkgEhFKdFCEc6nCUDQihO7RD6VjTeAU9DCMWpGcIRD2fJgBCKUyuELEOcDyEUp0YIRz6cJQNCKE7p
ELIVbT2EUJySIVS7I74UhFCcUiFkDrgdQihOiRDOdDhLBoRQnEtDONvhLBkQQnEuCSE7YcpACMXZGkLu
iC8HIRRnSwhZhigLIRRnbQhnP5wlA0IozpoQsgxRB0IozrkhZCtaPQihOOeEkDvi60IIxXkvhGxFqw8h
FOdUCJkDtoEQivNWCPf7PQFsBCEUJwqhB5A5YDsIoTjLEHIJ2h5CKM5xCNmKlgMhFOclhGxFy4MQivMS
QuaAeRBCce7v7w8PDw/PP0EGhBAgGUIIkAwhBEiGEAIkQwgBkiGEAMkQQoBkCCFAMoQQIBlCCJAMIQRI
hhACJEMIAZIhhADJEEKAZAghQCqHw1+3X4/5VqYnBQAAAABJRU5ErkJggg==
</value>
</data>
<data name="buttonUp.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAYAAAA+s9J6AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
vwAADr8BOAVTJAAACBBJREFUeF7tnTtOI0sARcmJiIyENAEBSKQkLIAFkLFBIlbAeohIkNiB37vMWBqY
BmO7PrfqniMdjeZv7D7uqq4yfbSGYXl9fV3f3t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L4SYQhE6CsRhkCEvhJhCEToKxGGQIS+EmEIROgrEYZAhL4SYQhE6CsRhkCEvhJhCEToKxGGQIS+EmEI
ROgrEYZAhL4SYQhE6CsRhkCEvhJhCEToKxGGQIS+EmEIROgrEYZAhL4SYQhE6CsRhkCEvhJhCEToKxGG
QIS+EmEIROgrEYZAhL4SYQhE6CsRhkCEvhJhCEToKxGGQIS+EmEIROgrEYZAhL4SYQhE6CsRhkCEvhJh
CEToKxGGQIS+EmEIROgrEYZAhL4SYQhE6CsRhkCEvhJhCEToKxGGQIS+EmEIROgrEYZAhL4SYQhE6CsR
hkCEvhJhCEToKxGGQIS+EmEIROgrEYZAhL4SYQhE6CsRhkCEvhJhCEToKxGGQIS+EmEIROgrEYZAhL4S
YQhE6CsRhkCEvhJhCEToKxGGQIS+EmEIROgrEYZAhL4SYQhE6CsRhkCEvhJhCEToKxGGQIS+EmEIROgr
EYZAhL4SYQhE6CsRhkCEvhJhCEToKxGGQIS+EmEIROhrZoTr9X9wZ4/5j/w7SQAAAABJRU5ErkJggg==
</value>
</data>
</root>

View File

@ -11,7 +11,7 @@ namespace laba_0
// To customize application configuration such as set high DPI settings or default font, // To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration. // see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize(); ApplicationConfiguration.Initialize();
Application.Run(new Form1()); Application.Run(new FormBoat());
} }
} }
} }

View File

@ -0,0 +1,113 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Этот код создан программой.
// Исполняемая версия:4.0.30319.42000
//
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
// повторной генерации кода.
// </auto-generated>
//------------------------------------------------------------------------------
namespace laba_0.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("laba_0.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 вверх {
get {
object obj = ResourceManager.GetObject("вверх", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap влево {
get {
object obj = ResourceManager.GetObject("влево", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap вниз {
get {
object obj = ResourceManager.GetObject("вниз", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap вниз1 {
get {
object obj = ResourceManager.GetObject("вниз1", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap вправа {
get {
object obj = ResourceManager.GetObject("вправа", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}

View File

@ -0,0 +1,136 @@
<?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="вниз" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\вниз.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="влево" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\влево.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="вправа" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\вправа.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="вверх" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\вверх.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="вниз1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\вниз1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -2,11 +2,26 @@
<PropertyGroup> <PropertyGroup>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<TargetFramework>net7.0-windows</TargetFramework> <TargetFramework>net6.0-windows</TargetFramework>
<RootNamespace>laba_0</RootNamespace> <RootNamespace>laba_0</RootNamespace>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup> </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> </Project>