Исправил названия классов для последующих лаб

This commit is contained in:
gg12 darfren 2023-10-15 19:12:56 +04:00
parent 87888ff403
commit daa6d8c91f
3 changed files with 7 additions and 7 deletions

View File

@ -8,14 +8,14 @@ using Monorail.Entities;
namespace Monorail.DrawningObjects
{
public class DrawningAdvancedMonorail : DrawningMonorail
public class DrawningLocomotive : DrawningMonorail
{
public DrawningAdvancedMonorail(int speed, double weight, Color bodyColor, Color wheelColor, Color tireColor, int width, int height, int addWheelsNumb,
public DrawningLocomotive(int speed, double weight, Color bodyColor, Color wheelColor, Color tireColor, int width, int height, int addWheelsNumb,
Color additionalColor, bool secondCabine, bool magniteRail) : base(speed, weight, bodyColor, wheelColor, tireColor, width, height)
{
if(EntityMonorail != null)
{
EntityMonorail = new EntityAdvancedMonorail(speed, weight, bodyColor, wheelColor, tireColor,
EntityMonorail = new EntityLocomotive(speed, weight, bodyColor, wheelColor, tireColor,
addWheelsNumb, additionalColor, secondCabine, magniteRail);
}
}
@ -29,7 +29,7 @@ namespace Monorail.DrawningObjects
Brush windowBrush = new SolidBrush(Color.White);
if (EntityMonorail == null)
return;
if(EntityMonorail is not EntityAdvancedMonorail advancedMonorail)
if(EntityMonorail is not EntityLocomotive advancedMonorail)
{
return;
}

View File

@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace Monorail.Entities
{
public class EntityAdvancedMonorail : EntityMonorail
public class EntityLocomotive : EntityMonorail
{
public Color AdditionalColor { get; private set; }
public int AddWheelsNumb { get; private set; }
@ -15,7 +15,7 @@ namespace Monorail.Entities
public bool SecondCabine { get; private set; }
public bool MagniteRail { get; private set; }
public EntityAdvancedMonorail(int speed, double weight, Color bodyColor, Color wheelColor,
public EntityLocomotive(int speed, double weight, Color bodyColor, Color wheelColor,
Color tireColor, int addWheelsNumb, Color secondCabineColor, bool secondCabine, bool magniteRail) : base(speed, weight, bodyColor, wheelColor, tireColor)
{
AdditionalColor = secondCabineColor;

View File

@ -92,7 +92,7 @@ namespace Monorail
if (dialog.ShowDialog() == DialogResult.OK)
additionalColor = dialog.Color;
int addWheelNumb = random.Next(3, 5);
_drawningMonorail = new DrawningAdvancedMonorail(random.Next(100, 300), random.Next(1000, 3000),
_drawningMonorail = new DrawningLocomotive(random.Next(100, 300), random.Next(1000, 3000),
bodyColor, wheelColor, tireColor,
pictureBoxMonorail.Width, pictureBoxMonorail.Height, addWheelNumb,
additionalColor, random.Next(0, 2) > 0, random.Next(0, 2) > 0);