Исправления
This commit is contained in:
parent
be78034cce
commit
fbef71ec0b
@ -178,10 +178,8 @@ namespace ArmoredCar
|
||||
return (_startPosX, _startPosX + _carWidth, _startPosY, _startPosY + _carHeight);
|
||||
}
|
||||
|
||||
public void setColor(Color color) {
|
||||
if (ArmoredCar == null)
|
||||
return;
|
||||
ArmoredCar.setColor(color);
|
||||
public virtual void setColor(Color color) {
|
||||
ArmoredCar = new EntityArmoredCar(ArmoredCar.Speed, ArmoredCar.Weight, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -47,11 +47,15 @@ namespace ArmoredCar
|
||||
base.DrawTransport(g);
|
||||
_startPosY -= 10;
|
||||
}
|
||||
public override void setColor(Color color)
|
||||
{
|
||||
ArmoredCar = new EntityTank(ArmoredCar.Speed, ArmoredCar.Weight, color,
|
||||
(ArmoredCar as EntityTank).DopColor, (ArmoredCar as EntityTank).TowerWeapon, (ArmoredCar as EntityTank).AMachineGun);
|
||||
}
|
||||
public void setDopColor(Color color)
|
||||
{
|
||||
if (ArmoredCar is not EntityTank Tank)
|
||||
return;
|
||||
Tank.setDopColor(color);
|
||||
ArmoredCar = new EntityTank(ArmoredCar.Speed, ArmoredCar.Weight, ArmoredCar.BodyColor,
|
||||
color, (ArmoredCar as EntityTank).TowerWeapon, (ArmoredCar as EntityTank).AMachineGun);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,5 @@ namespace ArmoredCar
|
||||
Weight = weight <= 0 ? rnd.Next(40, 70) : weight;
|
||||
BodyColor = bodyColor;
|
||||
}
|
||||
|
||||
public virtual void setColor(Color color) { BodyColor = color; }
|
||||
}
|
||||
}
|
||||
|
@ -39,7 +39,5 @@ namespace ArmoredCar
|
||||
TowerWeapon = towerWeapon;
|
||||
AMachineGun = aMachineGun;
|
||||
}
|
||||
|
||||
public void setDopColor(Color dopColor){DopColor = dopColor;}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user