Готово.

This commit is contained in:
Андрей Байгулов 2023-12-26 23:33:13 +04:00
parent 71063352db
commit f433aaf59b

View File

@ -12,7 +12,7 @@ namespace ProjectElectricLocomotive
private Wheels amount; private Wheels amount;
public void SetAmount(int a) public void SetAmount(int a)
{ {
if (a == 2) if (a <= 2)
{ {
amount = Wheels.Two; amount = Wheels.Two;
} }
@ -20,7 +20,7 @@ namespace ProjectElectricLocomotive
{ {
amount = Wheels.Three; amount = Wheels.Three;
} }
else if (a == 4) else if (a >= 4)
{ {
amount = Wheels.Four; amount = Wheels.Four;
} }
@ -30,7 +30,7 @@ namespace ProjectElectricLocomotive
Brush wheelsColor = new SolidBrush(Color.Black); Brush wheelsColor = new SolidBrush(Color.Black);
if (amount == Wheels.Two) if (amount == Wheels.Two)
g.FillEllipse(wheelsColor, _startPosX + 90, _startPosY + 45, 10, 10); g.FillEllipse(wheelsColor, _startPosX + 90, _startPosY + 45, 10, 10);
g.FillEllipse(wheelsColor, _startPosX + 100, _startPosY + 45, 10, 10); g.FillEllipse(wheelsColor, _startPosX + 140, _startPosY + 45, 10, 10);
if (amount == Wheels.Three) if (amount == Wheels.Three)
{ {