diff --git a/ProjectMonorail/.idea/vcs.xml b/ProjectMonorail/.idea/vcs.xml new file mode 100644 index 0000000..6c0b863 --- /dev/null +++ b/ProjectMonorail/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/ProjectMonorail/src/DrawingModernMonorail.java b/ProjectMonorail/src/DrawingModernMonorail.java index c564e94..4b81c61 100644 --- a/ProjectMonorail/src/DrawingModernMonorail.java +++ b/ProjectMonorail/src/DrawingModernMonorail.java @@ -16,6 +16,7 @@ public class DrawingModernMonorail { public EntityModernMonorail getMonorail() {return _entityMonorail;} public DrawingWheels getWheels() {return _wheels;} + private int _wheelsSeed; public void Initialization(int speed, float weight, Color bodyColor, Color additionalColor, boolean monorailTrack, boolean cabin) { @@ -24,6 +25,7 @@ public class DrawingModernMonorail { _wheels = new DrawingWheels(); Random rnd = new Random(); _wheels.SetCountWheels(2 + rnd.nextInt(0, 3)); + _wheelsSeed = rnd.nextInt(0, 2); } public boolean SetPictureSize(int width, int height) @@ -165,7 +167,7 @@ public class DrawingModernMonorail { } else if (coordinatesX.length == 3) { Random rnd = new Random(); - if (rnd.nextInt(0, 2) == 1) { + if (_wheelsSeed == 1) { coordinatesX[2] = _startPositionX + 25; } else { @@ -221,7 +223,7 @@ public class DrawingModernMonorail { } else if (coordinatesX.length == 3) { Random rnd = new Random(); - if (rnd.nextInt(0, 2) == 1) { + if (_wheelsSeed == 1) { coordinatesX[2] = _startPositionX - 35 + offset; } else {