import java.awt.*; public class DrawingRoundDecks implements IDrawingDecks { private DecksCount decksCount; private Color color; public DrawingRoundDecks(int decksCount, Color bodyColor) { setDecksCount(decksCount); color = bodyColor; } public void setDecksCount(int num) { if (num <= 1) { decksCount = DecksCount.One; } else if (num >= 3) { decksCount = DecksCount.Three; } else { decksCount = DecksCount.Two; } } public void draw(Graphics2D g, int x, int y, int shipWidth, int shipHeight) { g.setColor(color != null ? color : Color.BLACK); switch (decksCount) { case Two: { g.fillOval(x, y, 20, 20); } case Three: { g.fillOval(x + shipWidth - 20, y, 20, 20); } } } }