updated constructor
This commit is contained in:
parent
b9b074c809
commit
fbf7485bd1
@ -17,11 +17,12 @@ public class DrawingLiner {
|
|||||||
public void init(int speed, double weight, Color primaryColor,
|
public void init(int speed, double weight, Color primaryColor,
|
||||||
Color secondaryColor, LinerEntityType type,
|
Color secondaryColor, LinerEntityType type,
|
||||||
int capacity, int maxPassengers,
|
int capacity, int maxPassengers,
|
||||||
boolean hasExtraDeck, boolean hasPool) {
|
boolean hasExtraDeck, boolean hasPool, int deckNum) {
|
||||||
linerEntity = new LinerEntity();
|
linerEntity = new LinerEntity();
|
||||||
deckDrawing = new DeckDrawing();
|
deckDrawing = new DeckDrawing();
|
||||||
linerEntity.init(speed, weight, primaryColor, secondaryColor,
|
linerEntity.init(speed, weight, primaryColor, secondaryColor,
|
||||||
type, capacity, maxPassengers, hasExtraDeck, hasPool);
|
type, capacity, maxPassengers, hasExtraDeck, hasPool);
|
||||||
|
deckDrawing.setDeckEnum(deckNum);
|
||||||
pictureWidth = null;
|
pictureWidth = null;
|
||||||
pictureHeight = null;
|
pictureHeight = null;
|
||||||
startPosX = null;
|
startPosX = null;
|
||||||
|
@ -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)),
|
||||||
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,
|
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(),
|
drawingLiner.setPictureSize(pictureBoxLiner.getWidth(),
|
||||||
pictureBoxLiner.getHeight());
|
pictureBoxLiner.getHeight());
|
||||||
drawingLiner.setPosition(random.nextInt(pictureBoxLiner.getWidth()),
|
drawingLiner.setPosition(random.nextInt(pictureBoxLiner.getWidth()),
|
||||||
random.nextInt(pictureBoxLiner.getHeight()));
|
random.nextInt(pictureBoxLiner.getHeight()));
|
||||||
|
|
||||||
drawingLiner.setDeckNum(numberOfDecks);
|
|
||||||
|
|
||||||
drawTransport();
|
drawTransport();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user