From 52c006a00a574356fcb4578fe81c80d3db40f0c1 Mon Sep 17 00:00:00 2001 From: h8floom Date: Sat, 8 Jun 2024 13:34:28 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9B=D0=B0=D0=B1=D0=BE=D1=80=D0=B0=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D0=BD=D0=B0=D1=8F=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=B0=20=E2=84=962?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/DrawingShip/DrawingContainerShip.java | 49 ++++++++++++------ .../src/DrawingShip/DrawingShip.java | 1 + .../DiffDecks/DeckType2.class | Bin 1663 -> 1663 bytes .../DrawingShip/DrawingContainerShip$1.class | Bin 755 -> 755 bytes .../DrawingShip/DrawingContainerShip.class | Bin 2513 -> 2619 bytes .../DrawingShip/DrawingShip$1.class | Bin 1086 -> 1086 bytes .../DrawingShip/DrawingShip.class | Bin 4528 -> 4536 bytes 7 files changed, 35 insertions(+), 15 deletions(-) diff --git a/ProjectContainerShip/src/DrawingShip/DrawingContainerShip.java b/ProjectContainerShip/src/DrawingShip/DrawingContainerShip.java index d2a4063..08d7958 100644 --- a/ProjectContainerShip/src/DrawingShip/DrawingContainerShip.java +++ b/ProjectContainerShip/src/DrawingShip/DrawingContainerShip.java @@ -1,5 +1,5 @@ package DrawingShip; -import Entities.EntityContainerShip; +import DiffDecks.DecksCount; import Entities.EntityContainerShip; import java.awt.*; @@ -9,28 +9,39 @@ public class DrawingContainerShip extends DrawingShip { EntityShip = new EntityContainerShip(speed, weight, bodycolor, additionalcolor, crane, container); SetAmountandTypeDecks(); } + @Override public void DrawTransport(Graphics2D g) { if (EntityShip == null || !(EntityShip instanceof EntityContainerShip containerShip) || _StartPosX == null || _StartPosY == null) return; - int y = _StartPosY; + + int originalStartPosY = _StartPosY; + int containerOffsetY = 0; + if (containerShip.Crane) { int craneX = _StartPosX + drawingShipWidth - 40; int craneY = _StartPosY + drawingShipHeight - 90; - //кран + + g.setColor(Color.BLACK); g.drawLine(craneX + 10, craneY + 40, craneX + 10, craneY); g.drawLine(craneX + 10, craneY, craneX + 50, craneY); g.drawLine(craneX + 10, craneY, craneX + 50, craneY + 5); g.drawLine(craneX + 50, craneY, craneX + 50, craneY + 30); - // хваталка крана + g.drawLine(craneX + 40, craneY + 30, craneX + 60, craneY + 30); g.drawLine(craneX + 40, craneY + 30, craneX + 40, craneY + 35); g.drawLine(craneX + 60, craneY + 30, craneX + 60, craneY + 35); - _StartPosY += 30; + containerOffsetY += 30; } + + + _StartPosY += containerOffsetY; super.DrawTransport(g); + _StartPosY = originalStartPosY; + + int count_decks = 0; if (drawingDecks.getNumberOfDecks() != null) { switch (drawingDecks.getNumberOfDecks()) { @@ -45,19 +56,27 @@ public class DrawingContainerShip extends DrawingShip { break; } } - if (containerShip.Container) { - g.setColor(Color.BLACK); - g.drawRect(_StartPosX + 70, _StartPosY + 15, 40, 15); - g.setColor(containerShip.getAdditionalColor()); - g.fillRect(_StartPosX + 70, _StartPosY + 15, 40, 15); - g.setColor(Color.BLACK); - g.drawRect(_StartPosX + 90, _StartPosY + 20, 40, 15); - g.setColor(containerShip.getAdditionalColor()); - g.fillRect(_StartPosX + 90, _StartPosY + 20, 40, 15); + int containerY; + if (count_decks == 0) { + containerY = _StartPosY + 15; + } else { + containerY = _StartPosY + 15 + containerOffsetY; } + + if (containerShip.Container) { + // Draw containers + g.setColor(Color.BLACK); + g.drawRect(_StartPosX + 40, containerY, 40, 15); + g.setColor(containerShip.getAdditionalColor()); + g.fillRect(_StartPosX + 40, containerY, 40, 15); + g.setColor(Color.BLACK); + g.drawRect(_StartPosX + 60, containerY + 5, 40, 15); + g.setColor(containerShip.getAdditionalColor()); + g.fillRect(_StartPosX + 60, containerY + 5, 40, 15); + } + if (containerShip.Crane) { - _StartPosY -= 30; drawingShipHeight += 30; } } diff --git a/ProjectContainerShip/src/DrawingShip/DrawingShip.java b/ProjectContainerShip/src/DrawingShip/DrawingShip.java index 4a7862d..f41ddfc 100644 --- a/ProjectContainerShip/src/DrawingShip/DrawingShip.java +++ b/ProjectContainerShip/src/DrawingShip/DrawingShip.java @@ -119,6 +119,7 @@ public class DrawingShip extends JPanel { int y = _StartPosY; g.setColor(EntityShip.getBodyColor()); if (drawingDecks.getNumberOfDecks() != null) { + y += 30; switch (drawingDecks.getNumberOfDecks()) { case OneDeck: drawingDecks.DrawDecks(g, _StartPosX + 30, y, 80, 15, EntityShip.getBodyColor()); diff --git a/out/production/PIbd-11_Kudrinsky_O.S._ContainerShip_Hard/DiffDecks/DeckType2.class b/out/production/PIbd-11_Kudrinsky_O.S._ContainerShip_Hard/DiffDecks/DeckType2.class index d746e9e65d3a3f2ff1585ff439036a23c7c31b74..cce6d0f505f927a0d4090a48e5641826e0d88152 100644 GIT binary patch delta 49 zcmey*^PgwKB34yN25|-{22}CG D>(B__ delta 49 zcmey*^PgwKB34x?25|;y22}<*22BQe1|tRq22%z_273l21`h^hh6o@#jzM+uan>CG D?M?{s diff --git a/out/production/PIbd-11_Kudrinsky_O.S._ContainerShip_Hard/DrawingShip/DrawingContainerShip$1.class b/out/production/PIbd-11_Kudrinsky_O.S._ContainerShip_Hard/DrawingShip/DrawingContainerShip$1.class index 2e786d198ed62708d78981534e075f064313f01e..749096867a8f01fa59d0e492e67f561b4ef9981c 100644 GIT binary patch delta 13 Ucmey&`k8gZawbOo$t#$=0Vq8M0ssI2 delta 13 Ucmey&`k8gZawbNV$t#$=0VoCp_W%F@ diff --git a/out/production/PIbd-11_Kudrinsky_O.S._ContainerShip_Hard/DrawingShip/DrawingContainerShip.class b/out/production/PIbd-11_Kudrinsky_O.S._ContainerShip_Hard/DrawingShip/DrawingContainerShip.class index 5651b9bc8813cd0f5fbb64a6798fc06bb2995fe9..596c3c43cb8b67f7365a23e6f7ca3fa5d95dd45c 100644 GIT binary patch delta 933 zcmZXTNla5w6o$Xk_C0Dvcu=b%&@dQ;2TDY(A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575`esMRcTfEXp#Z|89ZELoDlodrhq`-v# E0N_=R1poj5 diff --git a/out/production/PIbd-11_Kudrinsky_O.S._ContainerShip_Hard/DrawingShip/DrawingShip$1.class b/out/production/PIbd-11_Kudrinsky_O.S._ContainerShip_Hard/DrawingShip/DrawingShip$1.class index 2f967cc7d873fc090e617360878d3d39538b0c2c..46cd0f37ef0548058561872608c50e11c5e5c23a 100644 GIT binary patch delta 13 UcmdnTv5#ZJEoR2*$+wx40Vh=jY5)KL delta 13 UcmdnTv5#ZJEoR25$+wx40VhxeX#fBK diff --git a/out/production/PIbd-11_Kudrinsky_O.S._ContainerShip_Hard/DrawingShip/DrawingShip.class b/out/production/PIbd-11_Kudrinsky_O.S._ContainerShip_Hard/DrawingShip/DrawingShip.class index ed16ba812f8867883201fd12abdc56eef4e03fb1..4650c05285ea54001cb3cc0dee5846ed019b13c7 100644 GIT binary patch delta 261 zcmXAjy-Pv?6vcn{SxSLE8qy^mf;1=*1_cJv;NBDsZ)s|22%7qm67!j+nAIEF`miB* zlbA^T2?{~r*yiTsP-BpnI`F$(4)aV@{x=q0TEH>Icv9$Ybi?xOWYE~(5TG= eoA~s>Jde6f=$i-)o|vSnDHH!JKdigX%)%G|p*Mp7 delta 237 zcmdm?yg_-xDL&4F4D1YS3=E8aCST?=(P7)fkgK(Y!C)stCL_Z(h624+3?T3sh#7&H z8HlBU*b#`kCdcwCY!2sdWn_+G5Sx5oK(s!Ap@yM>p_ZYUp^l*q$XdqG$Z(ROiQx=T z#>EW1jMo|Z7@soqGrne+!1$YCB0~$%Xgi3DfI8ZM zJfPbc<}u6%IzW!`9>a77UIr$h&Pav@4519nK>ex=3xO;a#;2kT;tY!z7BjFibOUwq QGq8y={9*8%+#{$10LBG3KL7v#