From 6c0134cffc6f3c232544e78020a7bdfd5e0b9698 Mon Sep 17 00:00:00 2001 From: devil_1nc Date: Mon, 5 Dec 2022 21:01:53 +0400 Subject: [PATCH] final --- DrawingAdvancedAirbus.java | 10 +++---- DrawingAirbus.java | 6 ++--- DrawingIlum.java | 4 +-- DrawingPlusIlum.java | 54 ++++++++++++++++++++++++++++++++++++++ DrawingSquareIlum.java | 46 +++++++++++++++++++++++++++++++- DrawingStarIlum.java | 3 --- 6 files changed, 109 insertions(+), 14 deletions(-) create mode 100644 DrawingPlusIlum.java delete mode 100644 DrawingStarIlum.java diff --git a/DrawingAdvancedAirbus.java b/DrawingAdvancedAirbus.java index 92b1023..7861055 100644 --- a/DrawingAdvancedAirbus.java +++ b/DrawingAdvancedAirbus.java @@ -13,10 +13,9 @@ public class DrawingAdvancedAirbus extends DrawingAirbus{ { EntityAdvancedAirbus advancedAirbus = (EntityAdvancedAirbus) Airbus; - g.setColor(advancedAirbus.ExtraColor); - if (advancedAirbus.SuperTurbine) { + g.setColor(advancedAirbus.ExtraColor); g.fillRect((int)_startPosX, (int)_startPosY + 20, 30, 22); g.drawLine((int)_startPosX, (int)_startPosY + 42, (int)_startPosX + 30, (int)_startPosY + 42); @@ -30,11 +29,12 @@ public class DrawingAdvancedAirbus extends DrawingAirbus{ _startPosY -= 5; if (advancedAirbus.ExtraCell) { - g.fillRect((int)_startPosX + 50, (int)_startPosY, 20, 15); - for (int i = (int)_startPosX + 50; i < (int)_startPosX + 70; i += 3) + g.setColor(advancedAirbus.ExtraColor); + g.fillRect((int)_startPosX + 55, (int)_startPosY + 15, 30, 10); + for (int i = (int)_startPosX + 57; i < (int)_startPosX + 83; i += 3) { g.setColor(Color.BLUE); - g.fillRect(i, (int)_startPosY + 7, 2, 2); + g.fillRect(i, (int)_startPosY + 20, 2, 2); } } diff --git a/DrawingAirbus.java b/DrawingAirbus.java index 7bf4c38..7f39cd9 100644 --- a/DrawingAirbus.java +++ b/DrawingAirbus.java @@ -17,15 +17,15 @@ public class DrawingAirbus { { int randExtra = random.nextInt(2); switch (random.nextInt(3)){ - /*case 0: - drawingilum = new DrawingStarIlum(randExtra); + case 0: + drawingilum = new DrawingPlusIlum(randExtra); break; case 1: drawingilum = new DrawingSquareIlum(randExtra); break; case 2: drawingilum = new DrawingIlum(randExtra, bodyColor); - break;*/ + break; } Airbus = new EntityAirbus(speed, weight, bodyColor); } diff --git a/DrawingIlum.java b/DrawingIlum.java index 9faa4cc..9d4dba8 100644 --- a/DrawingIlum.java +++ b/DrawingIlum.java @@ -1,6 +1,6 @@ import java.awt.*; -public class DrawingIlum { +public class DrawingIlum implements IDrawingIlum{ private DopIlum il = DopIlum.Ten; public void setIl(int num){ switch(num) @@ -18,7 +18,7 @@ public class DrawingIlum { } private Color color; - public DrawingIlum(int num, Color color) { + public DrawingIlum (int num, Color color) { setIl(num); this.color = color; } diff --git a/DrawingPlusIlum.java b/DrawingPlusIlum.java new file mode 100644 index 0000000..652644b --- /dev/null +++ b/DrawingPlusIlum.java @@ -0,0 +1,54 @@ +import java.awt.*; + +public class DrawingPlusIlum implements IDrawingIlum{ + private DopIlum il = DopIlum.Ten; + @Override + public void setIl(int num) { + switch(num) + { + case 0: + il = DopIlum.Twenty; + break; + case 1: + il = DopIlum.Thirty; + break; + default: + break; + } + } + public DrawingPlusIlum(int num){ + setIl(num); + } + @Override + public void DrawIl(int startPosX, int startPosY, Graphics2D g) { + g.setColor(Color.blue); + for (int tempX = 98; tempX > 38; tempX -= 6) { + g.fillRect( startPosX + tempX + 3, (int) startPosY + 20, 1, 5); + g.fillRect( startPosX + tempX, (int) startPosY + 23, 5, 1); + } + switch (il) { + case Twenty: { + for (int tempX = 98; tempX > 38; tempX -= 6) { + + g.fillRect( startPosX + tempX + 3, (int) startPosY + 26, 1, 5); + g.fillRect( startPosX + tempX, (int) startPosY + 29, 5, 1); + } + break; + } + case Thirty: { + for (int tempX = 98; tempX > 38; tempX -= 6) { + + g.fillRect( startPosX + tempX + 3, (int) startPosY + 26, 1, 5); + g.fillRect( startPosX + tempX, (int) startPosY + 29, 5, 1); + + g.fillRect( startPosX + tempX + 3, (int) startPosY + 33, 1, 5); + g.fillRect( startPosX + tempX, (int) startPosY + 34, 5, 1); + + } + break; + } + default: + break; + } + } +} diff --git a/DrawingSquareIlum.java b/DrawingSquareIlum.java index bffbb0d..8e5f070 100644 --- a/DrawingSquareIlum.java +++ b/DrawingSquareIlum.java @@ -1,2 +1,46 @@ -public class DrawingSquareIlum { +import java.awt.*; + +public class DrawingSquareIlum implements IDrawingIlum { + private DopIlum il = DopIlum.Ten; + @Override + public void setIl(int num) { + switch(num) + { + case 0: + il = DopIlum.Twenty; + break; + case 1: + il = DopIlum.Thirty; + break; + default: + break; + } + } + public DrawingSquareIlum(int num){ + setIl(num); + } + @Override + public void DrawIl(int startPosX, int startPosY, Graphics2D g) { + g.setColor(Color.blue); + for (int tempX = 98; tempX > 38; tempX -= 6) { + g.fillRect( startPosX + tempX, (int) startPosY + 20, 4, 4); + } + switch (il) { + case Twenty: { + for (int tempX = 98; tempX > 38; tempX -= 6) { + g.fillRect((int) startPosX + tempX, (int) startPosY + 26, 4, 4); + } + break; + } + case Thirty: { + for (int tempX = 98; tempX > 38; tempX -= 6) { + g.fillRect((int) startPosX + tempX, (int) startPosY + 25, 4, 4); + g.fillRect((int) startPosX + tempX, (int) startPosY + 30, 4, 4); + } + break; + } + default: + break; + } + } } diff --git a/DrawingStarIlum.java b/DrawingStarIlum.java deleted file mode 100644 index 6c5d2c7..0000000 --- a/DrawingStarIlum.java +++ /dev/null @@ -1,3 +0,0 @@ -public class DrawingStarIlum { - -}