ПИбд-23 Кислица Егор Дмитриевич Лабораторная работа №4 (усложненная) #4

Closed
Egor wants to merge 2 commits from Laba4 into Laba3
3 changed files with 5 additions and 11 deletions
Showing only changes of commit 807990537b - Show all commits

View File

@ -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;

View File

@ -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() {

View File

@ -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();
}
}