add inter

This commit is contained in:
NikGapon 2022-11-24 00:09:01 +04:00
parent 6670de85b2
commit cc24f550e0
3 changed files with 25 additions and 5 deletions

View File

@ -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 - 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 + _airplaneWidth - 35, _startPosY + _airplaneHeight + 25, 4, 4);
g.DrawEllipse(new(Color.Black, 2), _startPosX , _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) public void Upd_count_Porthole(CountPorthole count)
{ {

View File

@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace Airbus namespace Airbus
{ {
internal class DrawningPorthole internal class DrawningPorthole : IPorthole
{ {
private CountPorthole _countpornhole; private CountPorthole _countpornhole;
public int CountPorthole 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++) for (int i = 0; i < (int)CountPorthole / 2; i++)
{ {
g.DrawEllipse(new(color, 2), posX + 125 - i * 7, posY + 30, 5, 5); DrawPorthole(g, color, posX + 125 - i * 7, posY + 30);
g.DrawEllipse(new(color, 2), posX + 125 - i * 7, posY + 40, 5, 5); 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);
}
} }
} }

View File

@ -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);
}
}