diff --git a/Airbus/Airbus/DrawingAirplane.cs b/Airbus/Airbus/DrawingAirplane.cs index 481ba45..71af918 100644 --- a/Airbus/Airbus/DrawingAirplane.cs +++ b/Airbus/Airbus/DrawingAirplane.cs @@ -97,7 +97,7 @@ namespace Airbus g.DrawEllipse(new(Color.Black, 2), _startPosX + _airplaneWidth - 30, _startPosY + _airplaneHeight + 25, 4, 4); g.DrawEllipse(new(Color.Black, 2), _startPosX + _airplaneWidth - 35, _startPosY + _airplaneHeight + 25, 4, 4); g.DrawEllipse(new(Color.Black, 2), _startPosX , _startPosY + _airplaneHeight + 25, 4, 4); - porthole.DrawPorthole(g, Color.Red, _startPosX, _startPosY); + porthole.DrawPortholes(g, Color.Red, _startPosX, _startPosY); } public void Upd_count_Porthole(CountPorthole count) { diff --git a/Airbus/Airbus/DrawningPorthole.cs b/Airbus/Airbus/DrawningPorthole.cs index 30b5273..75fff1c 100644 --- a/Airbus/Airbus/DrawningPorthole.cs +++ b/Airbus/Airbus/DrawningPorthole.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace Airbus { - internal class DrawningPorthole + internal class DrawningPorthole : IPorthole { private CountPorthole _countpornhole; public int CountPorthole @@ -18,15 +18,20 @@ namespace Airbus } } - public void DrawPorthole(Graphics g, Color color, float posX, float posY) + public void DrawPortholes(Graphics g, Color color, float posX, float posY) { for (int i = 0; i < (int)CountPorthole / 2; i++) { - g.DrawEllipse(new(color, 2), posX + 125 - i * 7, posY + 30, 5, 5); - g.DrawEllipse(new(color, 2), posX + 125 - i * 7, posY + 40, 5, 5); + DrawPorthole(g, color, posX + 125 - i * 7, posY + 30); + DrawPorthole(g, color, posX + 125 - i * 7, posY + 40); } } + public virtual void DrawPorthole(Graphics g, Color color, float posX, float posY) + { + g.DrawEllipse(new(color, 2), posX, posY, 5, 5); + + } } } diff --git a/Airbus/Airbus/IPorthole.cs b/Airbus/Airbus/IPorthole.cs new file mode 100644 index 0000000..fda8628 --- /dev/null +++ b/Airbus/Airbus/IPorthole.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Airbus +{ + internal interface IPorthole + { + int CountPorthole { get; set; } + + public void DrawPorthole(Graphics g, Color color, float posX, float posY); + } +}