2023-09-25 18:40:25 +04:00
|
|
|
import java.awt.*;
|
|
|
|
|
2023-10-09 23:11:13 +04:00
|
|
|
public class DrawingDecks implements IDecksDrawing{
|
|
|
|
private NumberOfDecks numDecks;
|
2023-09-25 18:40:25 +04:00
|
|
|
public NumberOfDecks getProperty(){
|
|
|
|
return numDecks;
|
|
|
|
}
|
|
|
|
public void setNumDecks(int nDecks){
|
|
|
|
switch(nDecks){
|
|
|
|
case 1:
|
|
|
|
numDecks = NumberOfDecks.Deck_1;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
numDecks = NumberOfDecks.Deck_2;
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
numDecks = NumberOfDecks.Deck_3;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
numDecks = NumberOfDecks.Deck_1;
|
|
|
|
System.out.println("Что-то пошло не так, количество палуб неверное" + Integer.toString(nDecks) + "сделаем вид, будто она одна");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2023-10-09 23:11:13 +04:00
|
|
|
public void DrawDeck(int _startPosX, int _startPosY,Color bodyColor, Graphics2D g){
|
2023-09-25 18:40:25 +04:00
|
|
|
if(numDecks == NumberOfDecks.Deck_1){
|
|
|
|
|
|
|
|
}
|
|
|
|
if(numDecks == NumberOfDecks.Deck_2){
|
|
|
|
g.setPaint(Color.BLACK);
|
|
|
|
g.drawLine(_startPosX + 120, _startPosY + 75, _startPosX+ 55, _startPosY + 75);
|
|
|
|
}
|
|
|
|
if(numDecks == NumberOfDecks.Deck_3){
|
|
|
|
g.setPaint(Color.BLACK);
|
|
|
|
g.drawLine(_startPosX + 120, _startPosY + 75, _startPosX+ 55, _startPosY + 75);
|
|
|
|
g.drawLine(_startPosX + 125, _startPosY + 70, _startPosX+ 50, _startPosY + 70);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|