PIbd-21 Belianin N.N. LabWork04 Hard #5

Closed
Belnik wants to merge 12 commits from LabWork04 into LabWork03
Showing only changes of commit 3f1e52e587 - Show all commits

View File

@ -3,7 +3,7 @@ import java.awt.image.BufferedImage;
public class TanksGenericCollections<T extends DrawingArmoVehicle, U extends IMoveableObject> {
// Высота и ширина окна прорисовки
// Высота и Ширина окна прорисовки
private int _pictureWidth;
private int _pictureHeight;
@ -14,7 +14,7 @@ public class TanksGenericCollections<T extends DrawingArmoVehicle, U extends IMo
// Набор объектов
private SetGeneric<T> _collection;
// Конструтор
// Конструктор
public TanksGenericCollections(int pictureWidth, int pictureHeight) {
int width = pictureWidth / _placeSizeWidth;
int height = pictureHeight / _placeSizeHeight;
@ -47,18 +47,17 @@ public class TanksGenericCollections<T extends DrawingArmoVehicle, U extends IMo
// Вывод всего набора объектов
public BufferedImage ShowTank() {
BufferedImage bmp = new BufferedImage(_pictureWidth, _pictureHeight, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = bmp.createGraphics();
BufferedImage bitmap = new BufferedImage(_pictureWidth, _pictureHeight, BufferedImage.TYPE_INT_ARGB);
Graphics2D g = bitmap.createGraphics();
DrawBackground(g);
DrawObjects(g);
g.dispose();
return bmp;
return bitmap;
}
// Метод отрисовки фона
private void DrawBackground(Graphics g) {
g.setColor(Color.BLACK);
for (int i = 0; i < _pictureWidth / _placeSizeWidth; i++) {
for (int j = 0; j < _pictureHeight / _placeSizeHeight + 1; ++j) {
// Линия разметки места