PIbd-22_Aleikin_A.M._AirBom.../DrawWings.java

28 lines
1.0 KiB
Java
Raw Normal View History

2022-12-13 22:45:40 +04:00
import java.awt.*;
public class DrawWings implements IDrawningEngines
{
private Engines numWings;
@Override
public void SetNumEngines(int i) { numWings = Engines.GetNumEngines(i); }
@Override
public void DrawningEngines(float _startPosX, float _startPosY, Graphics2D g2d, int _airBomberWidth, int _airBomberHeight)
{
switch(numWings)
{
case TwoEngines:
break;
case FourEngines:
g2d.fillRect((int)_startPosX + _airBomberWidth / 2 + 25, (int)_startPosY + _airBomberHeight / 2 - 10, 20, 10);
g2d.fillRect((int)_startPosX + _airBomberWidth / 2 + 25, (int)_startPosY + _airBomberHeight / 2, 20, 10);
break;
case SixEngines:
g2d.fillRect((int)_startPosX + _airBomberWidth / 2 + 25, (int)_startPosY + _airBomberHeight / 2 - 10, 20, 10);
g2d.fillRect((int)_startPosX + _airBomberWidth / 2 + 25, (int)_startPosY + _airBomberHeight / 2, 20, 10);
break;
}
}
}