Pibd-23_Zhelovanov_D.Y._Bat.../DrawningLinkor.java

45 lines
1.5 KiB
Java
Raw Permalink Normal View History

2022-12-06 17:23:28 +04:00
import java.awt.*;
public class DrawningLinkor extends DrawningBattleship {
public DrawningLinkor(int speed, float weight, Color bodyColor, Color dopColor, boolean turret, boolean missileBay) {
super(speed, weight, bodyColor, 120, 50);
Battleship = new EntityLinkor(speed, weight, bodyColor, dopColor, turret, missileBay);
}
2022-12-20 21:50:09 +04:00
public DrawningLinkor(EntityBattleship battleship, IDrawningBlocks blocks){
super(battleship, blocks);
Battleship = battleship;
}
2022-12-06 17:23:28 +04:00
@Override
public void DrawTransport(Graphics2D g) {
if(!(Battleship instanceof EntityLinkor linkor))
{
return;
}
super.DrawTransport(g);
EntityLinkor entityLinkor = (EntityLinkor) Battleship;
if (entityLinkor.turret)
{
2022-12-22 22:27:39 +04:00
2022-12-06 17:23:28 +04:00
g.setColor(entityLinkor.dopColor);
g.fillOval((int)_startPosX + 15, (int)_startPosY, 20, 20);
g.fillOval((int) _startPosX + 15, (int)_startPosY + 30, 20, 20);
g.setColor(Color.BLACK);
g.fillRect((int)_startPosX + 20, (int)_startPosY+5, 23, 7);
g.fillRect((int)_startPosX + 20,(int) _startPosY + 37, 23, 7);
}
if (entityLinkor.missileBay)
{
g.setColor(Color.BLACK);
g.fillOval((int)_startPosX, (int)_startPosY + 15, 20, 20);
g.setColor(entityLinkor.dopColor);
g.fillOval((int)_startPosX+5,(int) _startPosY + 20, 10, 10);
}
}
}