методы добавления из 3ей лабы исправлены на полиморфные
This commit is contained in:
parent
bcc4a0d32f
commit
791d5205b3
@ -58,7 +58,7 @@ public class FormGenerationAirbus extends JFrame {
|
||||
new Color(rand.nextInt(0, 256), rand.nextInt(0, 256), rand.nextInt(0, 256)),
|
||||
rand.nextBoolean(), rand.nextBoolean());
|
||||
}
|
||||
generic.addAirbus(entity);
|
||||
generic.add(entity);
|
||||
// генерация иллюминаторов
|
||||
IDrawningPortholes potholes;
|
||||
int n = rand.nextInt(3);
|
||||
@ -69,7 +69,7 @@ public class FormGenerationAirbus extends JFrame {
|
||||
else
|
||||
potholes = new DrawningPortholesSquare();
|
||||
potholes.SetCount(rand.nextInt(1,4)*10);
|
||||
generic.addPortholes(potholes);
|
||||
generic.add(potholes);
|
||||
|
||||
// отрисовка
|
||||
_airbus = generic.randomDrawingObject();
|
||||
|
@ -28,7 +28,7 @@ public class GenericParametrized<T extends EntityAirbus, U extends IDrawningPort
|
||||
_portholes = new ArrayList<U>();
|
||||
}
|
||||
|
||||
public boolean addAirbus(T airbus)
|
||||
public boolean add(T airbus)
|
||||
{
|
||||
if (airbus == null || CountAirbus >= MaxCountAirbus)
|
||||
return false;
|
||||
@ -37,7 +37,7 @@ public class GenericParametrized<T extends EntityAirbus, U extends IDrawningPort
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean addPortholes(U porthole)
|
||||
public boolean add(U porthole)
|
||||
{
|
||||
if (porthole == null || CountPortholes >= MaxCountPortoles)
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user