LabWork03: Фиксы
This commit is contained in:
parent
a2cf154aa4
commit
2f4b0a65e7
@ -16,21 +16,21 @@ public class EntityWithRollers<T extends EntityTracktor, U extends IDrawningRoll
|
|||||||
|
|
||||||
public boolean add(T entity) {
|
public boolean add(T entity) {
|
||||||
if (entitiesCount >= entities.length) {
|
if (entitiesCount >= entities.length) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
entities[entitiesCount++] = entity;
|
entities[entitiesCount++] = entity;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean add(U roller) {
|
public boolean add(U roller) {
|
||||||
if (rollersCount >= rollers.length) {
|
if (rollersCount >= rollers.length) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
rollers[rollersCount++] = roller;
|
rollers[rollersCount++] = roller;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IDrawningObject constructArtillery() {
|
public IDrawningObject constructTracktor() {
|
||||||
if (entitiesCount == 0 || rollersCount == 0) {
|
if (entitiesCount == 0 || rollersCount == 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -40,9 +40,9 @@ public class FormGallery extends JFrame {
|
|||||||
}
|
}
|
||||||
|
|
||||||
buttonRefresh.addActionListener(e -> {
|
buttonRefresh.addActionListener(e -> {
|
||||||
first = storage.constructArtillery();
|
first = storage.constructTracktor();
|
||||||
second = storage.constructArtillery();
|
second = storage.constructTracktor();
|
||||||
third = storage.constructArtillery();
|
third = storage.constructTracktor();
|
||||||
|
|
||||||
first.setObject(0, 10, pictureBox.getWidth(), pictureBox.getHeight());
|
first.setObject(0, 10, pictureBox.getWidth(), pictureBox.getHeight());
|
||||||
second.setObject(150, 10, pictureBox.getWidth(), pictureBox.getHeight());
|
second.setObject(150, 10, pictureBox.getWidth(), pictureBox.getHeight());
|
||||||
|
Loading…
Reference in New Issue
Block a user