2023-10-31 12:27:43 +04:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace Catamaran
|
|
|
|
|
{
|
|
|
|
|
public class DrawningCatamaranPro : DrawningCatamaran
|
|
|
|
|
{
|
2023-11-25 20:02:11 +04:00
|
|
|
|
public DrawningCatamaranPro(int speed, double weight, Color bodyColor, Color additionalColor, bool bodyKit, bool motor, bool sail, int width, int height) :
|
|
|
|
|
base(speed, weight, bodyColor, width, height)
|
2023-10-31 12:27:43 +04:00
|
|
|
|
{
|
|
|
|
|
if (EntityCatamaran != null)
|
|
|
|
|
{
|
2023-11-25 20:02:11 +04:00
|
|
|
|
EntityCatamaran = new EntityCatamaranPro(speed, weight, bodyColor, additionalColor,bodyKit, motor, sail);
|
2023-10-31 12:27:43 +04:00
|
|
|
|
}
|
|
|
|
|
}
|
2023-11-25 20:02:11 +04:00
|
|
|
|
public void ChangeAddColor(Color col)
|
|
|
|
|
{
|
|
|
|
|
((EntityCatamaranPro)EntityCatamaran).AdditionalColor = col;
|
|
|
|
|
}
|
|
|
|
|
|
2023-10-31 12:27:43 +04:00
|
|
|
|
public override void DrawTransport(Graphics g)
|
|
|
|
|
{
|
|
|
|
|
if (EntityCatamaran is not EntityCatamaranPro CatPro)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
base.DrawTransport(g);
|
|
|
|
|
Pen pen = new(Color.Black);
|
|
|
|
|
|
|
|
|
|
Brush additionalBrush = new SolidBrush(CatPro.AdditionalColor);
|
2023-11-25 20:02:11 +04:00
|
|
|
|
Brush floatsBrush = new SolidBrush(CatPro.AdditionalColor);
|
2023-10-31 12:27:43 +04:00
|
|
|
|
if (CatPro.Motor)
|
|
|
|
|
{
|
|
|
|
|
g.FillRectangle(additionalBrush, _startPosX, _startPosY+25, 10, 30);
|
|
|
|
|
g.DrawRectangle(pen, _startPosX, _startPosY+25, 10, 30);
|
|
|
|
|
g.DrawRectangle(pen, _startPosX+5, _startPosY+30, 5, 20);
|
|
|
|
|
}
|
|
|
|
|
if(CatPro.BodyKit)
|
|
|
|
|
{
|
|
|
|
|
g.FillRectangle(floatsBrush, _startPosX, _startPosY, _catamaranWidth - 20, 10);
|
|
|
|
|
g.DrawRectangle(pen, _startPosX, _startPosY, _catamaranWidth - 20, 10);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
g.FillRectangle(floatsBrush, _startPosX, _startPosY + 70, _catamaranWidth - 20, 10);
|
|
|
|
|
g.DrawRectangle(pen, _startPosX, _startPosY + 70, _catamaranWidth - 20, 10);
|
|
|
|
|
|
|
|
|
|
Point[] trig1 = { new Point(_startPosX + _catamaranWidth -20, _startPosY), new Point(_startPosX + _catamaranWidth, _startPosY + 5), new Point(_startPosX+_catamaranWidth - 20, _startPosY+10) };
|
|
|
|
|
g.DrawPolygon(pen, trig1);
|
|
|
|
|
Point[] trig2 = { new Point(_startPosX + _catamaranWidth - 20, _startPosY + 70), new Point(_startPosX + _catamaranWidth, _startPosY + 75), new Point(_startPosX + _catamaranWidth - 20, _startPosY + 80) };
|
|
|
|
|
g.DrawPolygon(pen, trig2);
|
2023-11-25 20:02:11 +04:00
|
|
|
|
|
2023-10-31 12:27:43 +04:00
|
|
|
|
for (int i = 10; i< 100; i+=10)
|
|
|
|
|
{
|
|
|
|
|
Point point1 = new Point(_startPosX+i, _startPosY);
|
|
|
|
|
Point point2 = new Point(_startPosX+i, _startPosY+10);
|
|
|
|
|
g.DrawLine(pen, point1, point2);
|
2023-11-25 20:02:11 +04:00
|
|
|
|
}
|
2023-10-31 12:27:43 +04:00
|
|
|
|
for (int i = 10; i< 100; i+=10)
|
|
|
|
|
{
|
|
|
|
|
Point point3 = new Point(_startPosX+i, _startPosY+70);
|
|
|
|
|
Point point4 = new Point(_startPosX+i, _startPosY+_catamaranHeight);
|
|
|
|
|
g.DrawLine(pen, point3, point4);
|
|
|
|
|
}
|
2023-11-25 20:02:11 +04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (CatPro.Sail)
|
|
|
|
|
{
|
|
|
|
|
SolidBrush machta = new SolidBrush(Color.Brown);
|
|
|
|
|
SolidBrush sail = new SolidBrush(Color.White);
|
|
|
|
|
Point[] pointf = { new Point(_startPosX+50, _startPosY+40), new Point(_startPosX+60,_startPosY+40), new Point(_startPosX+45, _startPosY+20), new Point(_startPosX+35, _startPosY+20) };
|
|
|
|
|
g.FillPolygon(sail,pointf);
|
|
|
|
|
g.DrawPolygon(pen,pointf);
|
|
|
|
|
g.FillEllipse(machta, _startPosX + 50, _startPosY + 35, 10, 10);
|
2023-10-31 12:27:43 +04:00
|
|
|
|
}
|
|
|
|
|
Point[] points = { new Point(_startPosX + _catamaranWidth - 35, _startPosY+20), new Point(_startPosX + _catamaranWidth - 10, _startPosY + 40), new Point(_startPosX + _catamaranWidth - 35, _startPosY + 60) };
|
|
|
|
|
g.FillPolygon(additionalBrush, points);
|
|
|
|
|
g.DrawPolygon(pen, points);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|