Added class DrawingAdvancedArtillery
This commit is contained in:
parent
145d4dac45
commit
4e7db63b49
28
DrawingAdvancedArtillery.java
Normal file
28
DrawingAdvancedArtillery.java
Normal file
@ -0,0 +1,28 @@
|
||||
import java.awt.*;
|
||||
|
||||
public class DrawingAdvancedArtillery extends DrawingArtillery {
|
||||
public DrawingAdvancedArtillery(int speed, float weight, Color bodyColor, int rollersCount, Color dopColor, boolean weapon, boolean salvoBattery) {
|
||||
super(speed, weight, bodyColor, rollersCount, 80, 50);
|
||||
artillery = new EntityAdvancedArtillery(speed, weight, bodyColor, dopColor, weapon, salvoBattery);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawTransport(Graphics2D g) {
|
||||
if (!(artillery instanceof EntityAdvancedArtillery advancedArtillery)) {
|
||||
return;
|
||||
}
|
||||
|
||||
g.setColor(advancedArtillery.getDopColor());
|
||||
if (advancedArtillery.getWeapon()) {
|
||||
g.setStroke(new BasicStroke(8));
|
||||
g.drawLine((int) _startPosX + _artilleryWidth / 2, (int) _startPosY + _artilleryHeight / 10, (int) _startPosX + _artilleryWidth, (int) _startPosY);
|
||||
}
|
||||
g.setStroke(new BasicStroke(6));
|
||||
if (advancedArtillery.getSalvoBattery()) {
|
||||
g.drawLine((int) _startPosX + _artilleryWidth / 4, (int) _startPosY + _artilleryHeight / 4, (int) _startPosX + _artilleryWidth / 4 + _artilleryHeight / 4, (int) _startPosY - 5);
|
||||
g.drawLine((int) _startPosX + _artilleryWidth / 4 - _artilleryHeight / 4, (int) _startPosY + _artilleryHeight / 4, (int) _startPosX + _artilleryWidth / 4, (int) _startPosY - 5);
|
||||
g.drawLine((int) _startPosX + _artilleryWidth / 4 - _artilleryHeight / 2, (int) _startPosY + _artilleryHeight / 4, (int) _startPosX + _artilleryWidth / 4 - _artilleryHeight / 4, (int) _startPosY - 5);
|
||||
}
|
||||
super.drawTransport(g);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user