Добавлены три реализации разных форм двигателя
This commit is contained in:
parent
8d19ef6890
commit
006cea0aca
26
AirBomber/AirBomber/AirplaneArrowEngines.cs
Normal file
26
AirBomber/AirBomber/AirplaneArrowEngines.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AirBomber
|
||||
{
|
||||
internal class AirplaneArrowEngines : DrawningAirplaneEngines
|
||||
{
|
||||
protected override void DrawEngine(Graphics g, Color colorAirplane, RectangleF rectAroundEngine)
|
||||
{
|
||||
var x = rectAroundEngine.X + rectAroundEngine.Width / 4;
|
||||
g.FillPolygon(new SolidBrush(colorAirplane), new PointF[]
|
||||
{
|
||||
new PointF(rectAroundEngine.Left, rectAroundEngine.Top + rectAroundEngine.Height / 2),
|
||||
new PointF(x, rectAroundEngine.Top),
|
||||
new PointF(x, rectAroundEngine.Bottom),
|
||||
});
|
||||
int margin = 2;
|
||||
g.FillRectangle(new SolidBrush(colorAirplane),
|
||||
x , rectAroundEngine.Top + margin,
|
||||
rectAroundEngine.Right - x, rectAroundEngine.Height - margin * 2);
|
||||
}
|
||||
}
|
||||
}
|
18
AirBomber/AirBomber/AirplaneRectEngines.cs
Normal file
18
AirBomber/AirBomber/AirplaneRectEngines.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AirBomber
|
||||
{
|
||||
internal class AirplaneRectEngines : DrawningAirplaneEngines
|
||||
{
|
||||
protected override void DrawEngine(Graphics g, Color colorAirplane, RectangleF rectAroundEngine)
|
||||
{
|
||||
g.FillRectangle(new SolidBrush(colorAirplane), rectAroundEngine);
|
||||
g.FillRectangle(new SolidBrush(Color.Black),
|
||||
rectAroundEngine.Left, rectAroundEngine.Top, rectAroundEngine.Width / 4, rectAroundEngine.Height);
|
||||
}
|
||||
}
|
||||
}
|
@ -37,7 +37,7 @@ namespace AirBomber
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawEngine(Graphics g, Color colorAirplane, RectangleF rectAroundEngine)
|
||||
protected virtual void DrawEngine(Graphics g, Color colorAirplane, RectangleF rectAroundEngine)
|
||||
{
|
||||
g.FillEllipse(new SolidBrush(colorAirplane), rectAroundEngine);
|
||||
g.FillEllipse(new SolidBrush(Color.Black),
|
||||
|
Loading…
Reference in New Issue
Block a user