private void DrawShip(Graphics graphics, IShip ship) { DrawVulnerableSectors(graphics, ship); DrawShipWedge(graphics, ship); if (ship.Board() > 0.5) { DrawMissileCircle(graphics, ship); } DrawShipHull(graphics, ship); var brush = ShipNames.Select(OwnShip, ship); WorldDrawText(graphics, brush, ship.Position, ship.Name); }
private void DrawShipWedge(Graphics graphics, IShip ship) { if (ship.Board() > 0.5) { return; } double size = WorldScale / 4; var pen = SignalPen; var points = new[] { WorldToDevice(graphics, ship.Position + Vector.Direction(ship.Heading + Math.PI / 4) * size), WorldToDevice(graphics, ship.Position + Vector.Direction(ship.Heading + Math.PI * 11 / 12) * size), WorldToDevice(graphics, ship.Position + Vector.Direction(ship.Heading - Math.PI * 11 / 12) * size), WorldToDevice(graphics, ship.Position + Vector.Direction(ship.Heading - Math.PI / 4) * size), }; if (!IsVisible(points)) { return; } graphics.DrawLine(pen, points[0], points[1]); graphics.DrawLine(pen, points[2], points[3]); }