Лабараторная работа №1

This commit is contained in:
IlyasValiulov 2024-02-25 22:38:36 +04:00
parent fe5cdc68d5
commit bf991f6eed
2 changed files with 5 additions and 5 deletions

View File

@ -86,7 +86,7 @@ public class DrawingWarmlyShip extends JPanel {
public void DrawTransport(Graphics2D g) { public void DrawTransport(Graphics2D g) {
if (EntityWarmlyShip == null || _StartPosX == null || _StartPosY == null) return; if (EntityWarmlyShip == null || _StartPosX == null || _StartPosY == null) return;
int y = _StartPosY; int y = _StartPosY;
if (EntityWarmlyShip.getSheepPipes()) { if (EntityWarmlyShip.getShipPipes()) {
//трубы //трубы
g.setColor(EntityWarmlyShip.getAdditionalColor()); g.setColor(EntityWarmlyShip.getAdditionalColor());
g.fillRect(_StartPosX + 70, _StartPosY, 12, 30); g.fillRect(_StartPosX + 70, _StartPosY, 12, 30);

View File

@ -6,18 +6,18 @@ public class EntityWarmlyShip {
public Color getBodyColor() {return BodyColor;} public Color getBodyColor() {return BodyColor;}
private Color AdditionalColor; private Color AdditionalColor;
public Color getAdditionalColor() {return AdditionalColor;} public Color getAdditionalColor() {return AdditionalColor;}
private boolean SheepPipes; private boolean ShipPipes;
public boolean getSheepPipes() {return SheepPipes;} public boolean getShipPipes() {return ShipPipes;}
private boolean FuelTank; private boolean FuelTank;
public boolean getFuelTank() {return FuelTank;} public boolean getFuelTank() {return FuelTank;}
public double Step; public double Step;
public void Init(int speed, double weight, Color bodycolor, Color additionalcolor, boolean sheeppipes, boolean fueltank) public void Init(int speed, double weight, Color bodycolor, Color additionalcolor, boolean shippipes, boolean fueltank)
{ {
Speed = speed; Speed = speed;
Weight = weight; Weight = weight;
BodyColor = bodycolor; BodyColor = bodycolor;
AdditionalColor = additionalcolor; AdditionalColor = additionalcolor;
SheepPipes = sheeppipes; ShipPipes = shippipes;
FuelTank = fueltank; FuelTank = fueltank;
Step = Speed * 100 / Weight; Step = Speed * 100 / Weight;
} }