PIbd-22_Bondarenko_M.S._War.../DrawDeck.java

33 lines
980 B
Java
Raw Permalink Normal View History

2022-11-16 18:24:14 +04:00
import java.awt.*;
2022-11-29 22:18:43 +04:00
public class DrawDeck implements IDrawningDeck {
2022-11-16 18:24:14 +04:00
private Deck deckCount;
2022-11-29 22:18:43 +04:00
@Override
2022-11-16 18:24:14 +04:00
public void SetDeckCount(int count){
deckCount = Deck.GetDeck(count);
}
2022-11-29 22:18:43 +04:00
@Override
2022-11-16 18:24:14 +04:00
public void DrawningDeck(float _startPosX, float _startPosY, int _warmlyShipWidth, Graphics2D g2d, Color bodyColor){
2022-11-29 22:21:03 +04:00
int count = 1;
2022-11-16 18:24:14 +04:00
switch (deckCount)
{
case One:
break;
case Two:
2022-11-29 22:21:03 +04:00
count = 2;
2022-11-16 18:24:14 +04:00
break;
case Three:
2022-11-29 22:21:03 +04:00
count = 3;
2022-11-16 18:24:14 +04:00
break;
}
2022-11-29 22:21:03 +04:00
for (int i = 1; i < count; ++i){
g2d.setColor(bodyColor);
g2d.fillRect((int)(_startPosX + _warmlyShipWidth / 5), (int)_startPosY - 20 * i, _warmlyShipWidth * 3 / 5, 20);
g2d.setColor(Color.BLACK);
g2d.drawRect((int)(_startPosX + _warmlyShipWidth / 5), (int)_startPosY - 20 * i, _warmlyShipWidth * 3 / 5, 20);
}
2022-11-16 18:24:14 +04:00
}
}