Переименование классов

This commit is contained in:
just1valery 2022-09-27 12:59:43 +04:00
parent 907be7656b
commit 2d821c9072
4 changed files with 15 additions and 8 deletions

View File

@ -1,11 +1,11 @@
namespace WarmlyShip
{
internal class DrawningWarmlyShip
internal class DrawningShip
{
/// <summary>
/// Класс-сущность
/// </summary>
public EntityWarmlyShip Ship { get; private set; }
public EntityShip Ship { get; private set; }
/// <summary>
/// Левая координата отрисовки коробля
/// </summary>
@ -38,7 +38,7 @@
/// <param name="bodyColor">Цвет основной части</param>
public void Init(int speed, float weight, Color bodyColor)
{
Ship = new EntityWarmlyShip();
Ship = new EntityShip();
Ship.Init(speed, weight, bodyColor);
}
/// <summary>
@ -133,11 +133,11 @@
g.FillPolygon(br, P);
Brush brBlue = new SolidBrush(Color.LightBlue);
g.FillRectangle(brBlue, _startPosX + 70, _startPosY + 1, 70, 34);
g.FillRectangle(brBlue, _startPosX + 50, _startPosY + 1, 100, 34);
Pen pen = new(Color.Black);
//границы коробля
g.DrawRectangle(pen, _startPosX + 70, _startPosY + 1 , 70, 34);
g.DrawRectangle(pen, _startPosX + 50, _startPosY + 1 , 100, 34);
g.DrawLine(pen, _startPosX, _startPosY + 35, _startPosX + 170, _startPosY + 35);
g.DrawLine(pen, _startPosX, _startPosY + 35, _startPosX + 50, _startPosY + 65);
g.DrawLine(pen, _startPosX + 50, _startPosY + 65, _startPosX + 150, _startPosY + 65);

View File

@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace WarmlyShip
{
internal class EntityWarmlyShip
internal class EntityShip
{
/// <summary>
/// Скорость

View File

@ -2,7 +2,7 @@ namespace WarmlyShip
{
public partial class FormShip : Form
{
private DrawningWarmlyShip _ship;
private DrawningShip _ship;
public FormShip()
{
InitializeComponent();
@ -22,7 +22,7 @@ namespace WarmlyShip
private void buttonCreate_Click(object sender, EventArgs e)
{
Random rnd = new();
_ship = new DrawningWarmlyShip();
_ship = new DrawningShip();
_ship.Init(rnd.Next(100, 300), rnd.Next(1000, 2000), Color.FromArgb(rnd.Next(0, 256), rnd.Next(0, 256), rnd.Next(0, 256)));
_ship.SetPosition(rnd.Next(10, 100), rnd.Next(10, 100), pictureBoxShip.Width, pictureBoxShip.Height);
toolStripStatusLabelSpeed.Text = $"Ñêîðîñòü: {_ship.Ship.Speed}";

View File

@ -0,0 +1,7 @@
{
"profiles": {
"WarmlyShip": {
"commandName": "Project"
}
}
}