fix
This commit is contained in:
parent
5a9d142e38
commit
a7d52f3692
@ -18,10 +18,10 @@ public class HardGeneric <T extends EntityBus,U extends IDraw> {
|
||||
|
||||
private int pictureBoxHeight;
|
||||
|
||||
public HardGeneric(int maxCountBuses, int countSecond, int width, int height) {
|
||||
public HardGeneric(int maxCountBuses, int maxCountDoors, int width, int height) {
|
||||
currentSize = 0;
|
||||
MaxCountBuses = maxCountBuses;
|
||||
MaxCountDoors = countSecond;
|
||||
MaxCountDoors = maxCountDoors;
|
||||
busArray = (T[]) new EntityBus[MaxCountBuses];
|
||||
doorArray = (U[]) new IDraw[MaxCountDoors];
|
||||
pictureBoxHeight = height;
|
||||
@ -42,11 +42,11 @@ public class HardGeneric <T extends EntityBus,U extends IDraw> {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int insertDoor(U inter) {
|
||||
if (doorArray[MaxCountBuses - 1] != null) {
|
||||
public int insertDoor(U door) {
|
||||
if (doorArray[MaxCountDoors - 1] != null) {
|
||||
return -1;
|
||||
}
|
||||
doorArray[0] = inter;
|
||||
doorArray[0] = door;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -55,7 +55,7 @@ public class HardGeneric <T extends EntityBus,U extends IDraw> {
|
||||
int indBus = rand.nextInt(0, currentSize);
|
||||
int indDoors = rand.nextInt(0,currentSize);
|
||||
EntityBus entity = busArray[indBus];
|
||||
IDraw inter = doorArray[indDoors];
|
||||
IDraw door = doorArray[indDoors];
|
||||
return new DrawningBus(entity.Speed(), entity.Weight(), entity.BodyColor(),
|
||||
pictureBoxWidth, pictureBoxHeight);
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ public class HardForm {
|
||||
canvas.repaint();
|
||||
}
|
||||
|
||||
private IDraw createDrawningDoor(){
|
||||
private IDraw createDrawningDoor() {
|
||||
return new DrawningDoor(pictureBoxWidth, pictureBoxHeight, 0, 0);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user