лаб - 4
This commit is contained in:
parent
75fa75b3eb
commit
1468070ed2
@ -9,13 +9,9 @@ namespace AircraftCarrier
|
|||||||
public class EntityAircraftCarrier
|
public class EntityAircraftCarrier
|
||||||
{
|
{
|
||||||
public int Speed { get; private set; }
|
public int Speed { get; private set; }
|
||||||
|
|
||||||
public float Weight { get; private set; }
|
public float Weight { get; private set; }
|
||||||
|
|
||||||
public Color BodyColor { get; private set; }
|
public Color BodyColor { get; private set; }
|
||||||
|
|
||||||
public float Step => Speed * 100 / Weight;
|
public float Step => Speed * 100 / Weight;
|
||||||
|
|
||||||
public EntityAircraftCarrier(int speed, float weight, Color bodyColor)
|
public EntityAircraftCarrier(int speed, float weight, Color bodyColor)
|
||||||
{
|
{
|
||||||
Random rnd = new Random();
|
Random rnd = new Random();
|
||||||
@ -23,6 +19,5 @@ namespace AircraftCarrier
|
|||||||
Weight = weight <= 0 ? rnd.Next(40, 70) : weight;
|
Weight = weight <= 0 ? rnd.Next(40, 70) : weight;
|
||||||
BodyColor = bodyColor;
|
BodyColor = bodyColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -25,7 +25,6 @@ namespace AircraftCarrier
|
|||||||
_aircraftcarrier?.DrawTransport(gr);
|
_aircraftcarrier?.DrawTransport(gr);
|
||||||
pictureBoxAircraftCarrier.Image = bmp;
|
pictureBoxAircraftCarrier.Image = bmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetData()
|
private void SetData()
|
||||||
{
|
{
|
||||||
Random rnd = new();
|
Random rnd = new();
|
||||||
|
Loading…
Reference in New Issue
Block a user