исправил
This commit is contained in:
parent
1703457b15
commit
e822561eec
@ -10,26 +10,23 @@ public class DrawDeck implements IDrawningDeck {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void DrawningDeck(float _startPosX, float _startPosY, int _warmlyShipWidth, Graphics2D g2d, Color bodyColor){
|
public void DrawningDeck(float _startPosX, float _startPosY, int _warmlyShipWidth, Graphics2D g2d, Color bodyColor){
|
||||||
|
int count = 1;
|
||||||
switch (deckCount)
|
switch (deckCount)
|
||||||
{
|
{
|
||||||
case One:
|
case One:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Two:
|
case Two:
|
||||||
g2d.setColor(bodyColor);
|
count = 2;
|
||||||
g2d.fillRect((int)(_startPosX + _warmlyShipWidth / 5), (int)_startPosY - 20, _warmlyShipWidth * 3 / 5, 20);
|
|
||||||
g2d.setColor(Color.BLACK);
|
|
||||||
g2d.drawRect((int)(_startPosX + _warmlyShipWidth / 5), (int)_startPosY - 20, _warmlyShipWidth * 3 / 5, 20);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Three:
|
case Three:
|
||||||
for (int i = 1; i < 3; ++i){
|
count = 3;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
for (int i = 1; i < count; ++i){
|
||||||
g2d.setColor(bodyColor);
|
g2d.setColor(bodyColor);
|
||||||
g2d.fillRect((int)(_startPosX + _warmlyShipWidth / 5), (int)_startPosY - 20 * i, _warmlyShipWidth * 3 / 5, 20);
|
g2d.fillRect((int)(_startPosX + _warmlyShipWidth / 5), (int)_startPosY - 20 * i, _warmlyShipWidth * 3 / 5, 20);
|
||||||
g2d.setColor(Color.BLACK);
|
g2d.setColor(Color.BLACK);
|
||||||
g2d.drawRect((int)(_startPosX + _warmlyShipWidth / 5), (int)_startPosY - 20 * i, _warmlyShipWidth * 3 / 5, 20);
|
g2d.drawRect((int)(_startPosX + _warmlyShipWidth / 5), (int)_startPosY - 20 * i, _warmlyShipWidth * 3 / 5, 20);
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,6 @@ public class DrawingShip extends JPanel {
|
|||||||
protected int _warmlyShipWidth = 125; //Ширина отрисовки корабля
|
protected int _warmlyShipWidth = 125; //Ширина отрисовки корабля
|
||||||
protected int _warmlyShipHeight = 50; //Высота отрисовки корабля
|
protected int _warmlyShipHeight = 50; //Высота отрисовки корабля
|
||||||
|
|
||||||
private int deckCount = 1;
|
|
||||||
private IDrawningDeck idd;
|
private IDrawningDeck idd;
|
||||||
|
|
||||||
//Инициализация
|
//Инициализация
|
||||||
|
Loading…
Reference in New Issue
Block a user