34 lines
972 B
Java
34 lines
972 B
Java
import java.awt.*;
|
|
|
|
public class DrawningSqareOars implements IDrawningOars{
|
|
private OarsCount _Oars;
|
|
@Override
|
|
public void SetOarsCount(int numOfOars) {_Oars = OarsCount.GetOarsCount(numOfOars); }
|
|
|
|
@Override
|
|
public void DrawOars(Graphics g, int _startPosX, int _startPosY) {
|
|
Graphics2D g2d = (Graphics2D) g;
|
|
g2d.setColor(Color.BLACK);
|
|
int numOfOars = 0;
|
|
switch (_Oars)
|
|
{
|
|
case One:
|
|
numOfOars = 1;
|
|
break;
|
|
case Two:
|
|
numOfOars = 2;
|
|
break;
|
|
case Three:
|
|
numOfOars = 3;
|
|
break;
|
|
}
|
|
for(int i = numOfOars; i >= 1; --i){
|
|
g2d.setColor(Color.CYAN);
|
|
g2d.fillRect(_startPosX + (15 * (i + 1)), _startPosY -15, 15, 15);
|
|
g2d.setColor(Color.BLACK);
|
|
g2d.drawRect(_startPosX + (15 * (i + 1)), _startPosY - 15, 15, 15);
|
|
|
|
}
|
|
}
|
|
}
|