ПИбд-23 Кислица Егор Дмитриевич Лабораторная работа №4 (усложненная) #4
@ -36,7 +36,7 @@ public class FormAirFighter {
|
||||
canv.repaint();
|
||||
}
|
||||
public void ChangeAirplane(DrawningAirplane newAirplane){
|
||||
newAirplane.SetPosition(0,0);
|
||||
newAirplane.SetPosition(0,70);
|
||||
DrawningAirplane = newAirplane;
|
||||
canv.DrawningAirplane = DrawningAirplane;
|
||||
|
||||
|
@ -107,8 +107,8 @@ public class FormAirFighterCollection {
|
||||
if(_trashCollection.GetSize() == 0)
|
||||
return;
|
||||
FormAirFighter form = new FormAirFighter();
|
||||
form.ChangeAirplane(_trashCollection.GetTop());
|
||||
_trashCollection.Pop();
|
||||
form.ChangeAirplane(_trashCollection.Pop());
|
||||
|
||||
}
|
||||
});
|
||||
addButton.addActionListener(new ActionListener() {
|
||||
|
@ -20,13 +20,7 @@ public class AirplaneTrashCollection <T extends DrawningAirplane> {
|
||||
return _queue.size();
|
||||
}
|
||||
|
||||
public void Pop(){
|
||||
if(_queue.size() ==0)
|
||||
return;
|
||||
_queue.remove();
|
||||
}
|
||||
|
||||
public T GetTop(){
|
||||
return _queue.peek();
|
||||
public T Pop(){
|
||||
return _queue.remove();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user