Ejemplo n.º 1
0
        private void DrawShipBorders(Canvas canvas, BattleShipsPlayer player)
        {
            var size = Math.Min(canvas.ActualHeight, canvas.ActualWidth);
            var rectSize = size / BORAD_SIZE;

            foreach (var ship in player.Ships)
            {
                canvas.DrawEmptyRect(ship.StartPoint.X*rectSize, ship.StartPoint.Y*rectSize,
                    ship.EndPoint.X*rectSize + rectSize, ship.EndPoint.Y*rectSize + rectSize);
            }
        }