улучшение рисунка, добавление паруса
This commit is contained in:
@@ -153,6 +153,7 @@ public class DrawingCatamaran
|
|||||||
|
|
||||||
};
|
};
|
||||||
g.FillPolygon(additionalBrush, Float);
|
g.FillPolygon(additionalBrush, Float);
|
||||||
|
g.DrawPolygon(Pens.Black, Float);
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Прорисовка объекта
|
/// Прорисовка объекта
|
||||||
@@ -167,49 +168,51 @@ public class DrawingCatamaran
|
|||||||
}
|
}
|
||||||
|
|
||||||
Pen pen = new(Color.Black);
|
Pen pen = new(Color.Black);
|
||||||
Brush additionalBrush = new SolidBrush(EntityCatamaran.AdditionalColor);
|
Brush BodyBrush = new SolidBrush(EntityCatamaran.BodyColor);
|
||||||
|
Brush additionalBrush = new SolidBrush(EntityCatamaran.AdditionalColor);
|
||||||
|
Pen additionalPen = new(EntityCatamaran.AdditionalColor, 2);
|
||||||
|
|
||||||
// границы катамарана
|
// границы катамарана
|
||||||
Point[] catamaranBorders = new Point[]
|
Point[] catamaranBorders = new Point[]
|
||||||
{
|
{
|
||||||
new Point(_startPosX.Value + 10, _startPosY.Value + 10),
|
new Point(_startPosX.Value + 10, _startPosY.Value + 10),
|
||||||
new Point(_startPosX.Value + 90, _startPosY.Value + 10),
|
new Point(_startPosX.Value + 80, _startPosY.Value + 10),
|
||||||
new Point(_startPosX.Value + 117, _startPosY.Value + 25),
|
new Point(_startPosX.Value + 107, _startPosY.Value + 30),
|
||||||
new Point(_startPosX.Value + 90, _startPosY.Value + 40),
|
new Point(_startPosX.Value + 80, _startPosY.Value + 45),
|
||||||
new Point(_startPosX.Value + 10, _startPosY.Value + 40),
|
new Point(_startPosX.Value + 10, _startPosY.Value + 45),
|
||||||
|
|
||||||
};
|
};
|
||||||
g.DrawPolygon(pen, catamaranBorders);
|
g.DrawPolygon(pen, catamaranBorders);
|
||||||
|
g.FillPolygon(BodyBrush, catamaranBorders);
|
||||||
g.DrawEllipse(pen, _startPosX.Value + 15, _startPosY.Value + 14, 73, 22);
|
|
||||||
|
|
||||||
if(EntityCatamaran.Floats)
|
g.DrawEllipse(pen, _startPosX.Value + 17, _startPosY.Value + 14, 65, 27);
|
||||||
|
g.FillEllipse(Brushes.White, _startPosX.Value + 17, _startPosY.Value + 14, 65, 27);
|
||||||
|
|
||||||
|
if(EntityCatamaran.Floaters)
|
||||||
{
|
{
|
||||||
g.DrawLine(pen, _startPosX.Value + 20, _startPosY.Value + 10, _startPosX.Value + 20, _startPosY.Value + 7);
|
g.DrawLine(pen, _startPosX.Value + 20, _startPosY.Value + 10, _startPosX.Value + 20, _startPosY.Value + 7);
|
||||||
g.DrawLine(pen, _startPosX.Value + 80, _startPosY.Value + 10, _startPosX.Value + 80, _startPosY.Value + 7);
|
g.DrawLine(pen, _startPosX.Value + 80, _startPosY.Value + 10, _startPosX.Value + 80, _startPosY.Value + 7);
|
||||||
g.DrawLine(pen, _startPosX.Value + 20, _startPosY.Value + 40, _startPosX.Value + 20, _startPosY.Value + 43);
|
g.DrawLine(pen, _startPosX.Value + 20, _startPosY.Value + 45, _startPosX.Value + 20, _startPosY.Value + 48);
|
||||||
g.DrawLine(pen, _startPosX.Value + 80, _startPosY.Value + 40, _startPosX.Value + 80, _startPosY.Value + 43);
|
g.DrawLine(pen, _startPosX.Value + 80, _startPosY.Value + 45, _startPosX.Value + 80, _startPosY.Value + 48);
|
||||||
|
|
||||||
DrawFloat(1, additionalBrush, g);
|
DrawFloat(1, additionalBrush, g);
|
||||||
DrawFloat(43, additionalBrush, g);
|
DrawFloat(48, additionalBrush, g);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (EntityCatamaran.Sail)
|
if (EntityCatamaran.Sail)
|
||||||
{
|
{
|
||||||
Pen thickPen = new(Color.Black, 3);
|
|
||||||
g.DrawLine(thickPen, _startPosX.Value + 40, _startPosY.Value + 22, _startPosX.Value + 40, _startPosY.Value + 28);
|
|
||||||
Point[] Sail = new Point[]
|
Point[] Sail = new Point[]
|
||||||
{
|
{
|
||||||
new Point(_startPosX.Value + 41, _startPosY.Value + 8),
|
new Point(_startPosX.Value + 50, _startPosY.Value + 35),
|
||||||
new Point(_startPosX.Value + 41, _startPosY.Value + 40),
|
new Point(_startPosX.Value + 35, _startPosY.Value + 29),
|
||||||
new Point(_startPosX.Value + 46, _startPosY.Value + 36),
|
new Point(_startPosX.Value + 35, _startPosY.Value + 14),
|
||||||
new Point(_startPosX.Value + 46, _startPosY.Value + 12),
|
new Point(_startPosX.Value + 50, _startPosY.Value + 8),
|
||||||
new Point(_startPosX.Value + 41, _startPosY.Value + 8),
|
new Point(_startPosX.Value + 50, _startPosY.Value + 33),
|
||||||
|
|
||||||
};
|
};
|
||||||
g.FillPolygon(additionalBrush, Sail);
|
g.FillPolygon(additionalBrush, Sail);
|
||||||
|
g.DrawPolygon(pen, Sail);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -25,7 +25,7 @@ public class EntityCatamaran
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Признак наличия поплавков слева и справа
|
/// Признак наличия поплавков слева и справа
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool Floats { get; private set; }
|
public bool Floaters { get; private set; }
|
||||||
|
|
||||||
public bool Sail { get; private set; }
|
public bool Sail { get; private set; }
|
||||||
|
|
||||||
@@ -41,15 +41,15 @@ public class EntityCatamaran
|
|||||||
/// <param name="weight">вес</param>
|
/// <param name="weight">вес</param>
|
||||||
/// <param name="bodyColor">основной цвет</param>
|
/// <param name="bodyColor">основной цвет</param>
|
||||||
/// <param name="additionalColor">доп цвет для паурса и поплавков</param>
|
/// <param name="additionalColor">доп цвет для паурса и поплавков</param>
|
||||||
/// <param name="floats">наличие поплавков</param>
|
/// <param name="floaters">наличие поплавков</param>
|
||||||
/// <param name="sail">наличие паруса</param>
|
/// <param name="sail">наличие паруса</param>
|
||||||
public void Init(int speed, double weight, Color bodyColor, Color additionalColor, bool floats, bool sail)
|
public void Init(int speed, double weight, Color bodyColor, Color additionalColor, bool floaters, bool sail)
|
||||||
{
|
{
|
||||||
Speed = speed;
|
Speed = speed;
|
||||||
Weight = weight;
|
Weight = weight;
|
||||||
BodyColor = bodyColor;
|
BodyColor = bodyColor;
|
||||||
AdditionalColor = additionalColor;
|
AdditionalColor = additionalColor;
|
||||||
Floats = floats;
|
Floaters = floaters;
|
||||||
Sail = sail;
|
Sail = sail;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user