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

34 lines
1.2 KiB
Java
Raw Normal View History

2022-11-16 18:24:14 +04:00
import java.awt.*;
public class DrawDeck {
private Deck deckCount;
public void SetDeckCount(int count){
deckCount = Deck.GetDeck(count);
}
public void DrawningDeck(float _startPosX, float _startPosY, int _warmlyShipWidth, Graphics2D g2d, Color bodyColor){
switch (deckCount)
{
case One:
break;
case Two:
g2d.setColor(bodyColor);
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;
case Three:
for (int i = 1; i < 3; ++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);
}
break;
}
}
}