updated constructor

This commit is contained in:
rozenkranzz 2025-02-10 11:01:08 +04:00
parent b9b074c809
commit fbf7485bd1
2 changed files with 3 additions and 4 deletions

View File

@ -17,11 +17,12 @@ public class DrawingLiner {
public void init(int speed, double weight, Color primaryColor,
Color secondaryColor, LinerEntityType type,
int capacity, int maxPassengers,
boolean hasExtraDeck, boolean hasPool) {
boolean hasExtraDeck, boolean hasPool, int deckNum) {
linerEntity = new LinerEntity();
deckDrawing = new DeckDrawing();
linerEntity.init(speed, weight, primaryColor, secondaryColor,
type, capacity, maxPassengers, hasExtraDeck, hasPool);
deckDrawing.setDeckEnum(deckNum);
pictureWidth = null;
pictureHeight = null;
startPosX = null;

View File

@ -140,14 +140,12 @@ public class FormLiner extends JFrame {
new Color(random.nextInt(256), random.nextInt(256), random.nextInt(256)),
new Color(random.nextInt(256), random.nextInt(256), random.nextInt(256)),
LinerEntityType.CARGO, random.nextInt(9000) + 1000,
random.nextInt(90) + 10, random.nextBoolean(), random.nextBoolean());
random.nextInt(90) + 10, random.nextBoolean(), random.nextBoolean(), numberOfDecks);
drawingLiner.setPictureSize(pictureBoxLiner.getWidth(),
pictureBoxLiner.getHeight());
drawingLiner.setPosition(random.nextInt(pictureBoxLiner.getWidth()),
random.nextInt(pictureBoxLiner.getHeight()));
drawingLiner.setDeckNum(numberOfDecks);
drawTransport();
}