Переименованы классы наследники от интерфейса ИнтерДоп

This commit is contained in:
Никита Потапов 2023-10-10 12:26:20 +04:00
parent 45f014ceae
commit 9f805eeba2
4 changed files with 17 additions and 17 deletions

View File

@ -23,17 +23,9 @@ public class DrawingEnginesEllipse implements IDrawingEngines {
@Override @Override
public void DrawEngine(Graphics2D g2d, Color color, int x, int y, int w, int h) { public void DrawEngine(Graphics2D g2d, Color color, int x, int y, int w, int h) {
Polygon enginePolygon = new Polygon();
enginePolygon.addPoint(x, y + h / 2);
enginePolygon.addPoint(x + w / 10, y);
enginePolygon.addPoint(x + w - w / 2, y + h / 2);
enginePolygon.addPoint(x + w, y);
enginePolygon.addPoint(x + w, y + h);
enginePolygon.addPoint(x + w - w / 2, y + h / 2);
enginePolygon.addPoint(x + w / 10, y + h);
g2d.setColor(Color.WHITE); g2d.setColor(Color.WHITE);
g2d.fillPolygon(enginePolygon); g2d.fillOval(x, y, w, h);
g2d.setColor(Color.BLACK); g2d.setColor(Color.BLACK);
g2d.drawPolygon(enginePolygon); g2d.drawOval(x, y, w, h);
} }
} }

View File

@ -2,7 +2,7 @@ package ProjectStormtrooper;
import java.awt.*; import java.awt.*;
public class DrawingEnginesWithFlame implements IDrawingEngines { public class DrawingEnginesPyramid implements IDrawingEngines {
private EnumEnginesCount _enumEnginesCount; private EnumEnginesCount _enumEnginesCount;
@Override @Override
@ -23,9 +23,17 @@ public class DrawingEnginesWithFlame implements IDrawingEngines {
@Override @Override
public void DrawEngine(Graphics2D g2d, Color color, int x, int y, int w, int h) { public void DrawEngine(Graphics2D g2d, Color color, int x, int y, int w, int h) {
Polygon enginePolygon = new Polygon();
enginePolygon.addPoint(x, y + h / 2);
enginePolygon.addPoint(x + w / 10, y);
enginePolygon.addPoint(x + w - w / 2, y + h / 2);
enginePolygon.addPoint(x + w, y);
enginePolygon.addPoint(x + w, y + h);
enginePolygon.addPoint(x + w - w / 2, y + h / 2);
enginePolygon.addPoint(x + w / 10, y + h);
g2d.setColor(Color.WHITE); g2d.setColor(Color.WHITE);
g2d.fillOval(x, y, w, h); g2d.fillPolygon(enginePolygon);
g2d.setColor(Color.BLACK); g2d.setColor(Color.BLACK);
g2d.drawOval(x, y, w, h); g2d.drawPolygon(enginePolygon);
} }
} }

View File

@ -2,7 +2,7 @@ package ProjectStormtrooper;
import java.awt.*; import java.awt.*;
public class DrawingEngines implements IDrawingEngines { public class DrawingEnginesSimple implements IDrawingEngines {
private EnumEnginesCount _enumEnginesCount; private EnumEnginesCount _enumEnginesCount;
@Override @Override

View File

@ -39,11 +39,11 @@ public class DrawingPlane {
Random random = new Random(); Random random = new Random();
int drawingEnginesType = random.nextInt(0, 3); int drawingEnginesType = random.nextInt(0, 3);
if (drawingEnginesType == 0) if (drawingEnginesType == 0)
_drawingEngines = new DrawingEngines(); _drawingEngines = new DrawingEnginesSimple();
else if (drawingEnginesType == 1) else if (drawingEnginesType == 1)
_drawingEngines = new DrawingEnginesEllipse(); _drawingEngines = new DrawingEnginesPyramid();
else if (drawingEnginesType == 2) else if (drawingEnginesType == 2)
_drawingEngines = new DrawingEnginesWithFlame(); _drawingEngines = new DrawingEnginesEllipse();
} }
protected DrawingPlane(int speed, double weight, Color bodyColor, protected DrawingPlane(int speed, double weight, Color bodyColor,