2022-09-26 19:55:09 +04:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
2022-09-26 20:23:23 +04:00
|
|
|
|
using System.Security.AccessControl;
|
2022-09-26 19:55:09 +04:00
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace Artilleries
|
|
|
|
|
{
|
|
|
|
|
internal class DrawingAdvancedArtillery : DrawingArtillery
|
|
|
|
|
{
|
|
|
|
|
public DrawingAdvancedArtillery(int speed, float weight, Color bodyColor, Color dopColor, bool weapon, bool salvoBattery) : base(speed, weight, bodyColor, 80, 50)
|
|
|
|
|
{
|
|
|
|
|
Artillery = new EntityAdvancedArtillery(speed, weight, bodyColor, dopColor, weapon, salvoBattery);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void DrawTransport(Graphics g)
|
|
|
|
|
{
|
|
|
|
|
if (Artillery is not EntityAdvancedArtillery advancedArtillery)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Pen pen = new Pen(advancedArtillery.DopColor, 8);
|
|
|
|
|
Brush brush = new SolidBrush(advancedArtillery.DopColor);
|
|
|
|
|
|
|
|
|
|
if (advancedArtillery.Weapon)
|
|
|
|
|
{
|
|
|
|
|
g.DrawLine(pen, _startPosX + _artilleryWidth / 2, _startPosY + _artilleryHeight / 10, _startPosX + _artilleryWidth, _startPosY);
|
|
|
|
|
}
|
2022-09-26 20:23:23 +04:00
|
|
|
|
pen.Width = 6;
|
2022-09-26 19:55:09 +04:00
|
|
|
|
if (advancedArtillery.SalvoBattery)
|
|
|
|
|
{
|
2022-09-26 20:23:23 +04:00
|
|
|
|
g.DrawLine(pen, _startPosX + _artilleryWidth / 4, _startPosY + _artilleryHeight / 4, _startPosX + _artilleryWidth / 4 + _artilleryHeight / 4, _startPosY - 5);
|
|
|
|
|
g.DrawLine(pen, _startPosX + _artilleryWidth / 4 - _artilleryHeight / 4, _startPosY + _artilleryHeight / 4, _startPosX + _artilleryWidth / 4, _startPosY - 5);
|
|
|
|
|
g.DrawLine(pen, _startPosX + _artilleryWidth / 4 - _artilleryHeight / 2, _startPosY + _artilleryHeight / 4, _startPosX + _artilleryWidth / 4 - _artilleryHeight / 4, _startPosY - 5);
|
2022-09-26 19:55:09 +04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
base.DrawTransport(g);
|
|
|
|
|
}
|
2022-10-24 21:49:26 +04:00
|
|
|
|
|
|
|
|
|
public override void SetBodyColor(Color color)
|
|
|
|
|
{
|
|
|
|
|
Artillery = new EntityAdvancedArtillery(Artillery.Speed, Artillery.Weight, color, (Artillery as EntityAdvancedArtillery).DopColor, (Artillery as EntityAdvancedArtillery).Weapon, (Artillery as EntityAdvancedArtillery).SalvoBattery);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SetDopColor(Color color)
|
|
|
|
|
{
|
|
|
|
|
Artillery = new EntityAdvancedArtillery(Artillery.Speed, Artillery.Weight, Artillery.BodyColor, color, (Artillery as EntityAdvancedArtillery).Weapon, (Artillery as EntityAdvancedArtillery).SalvoBattery);
|
|
|
|
|
}
|
2022-09-26 19:55:09 +04:00
|
|
|
|
}
|
|
|
|
|
}
|