BattleShip.Form1.Form1_MouseDown C# (CSharp) Method

Form1_MouseDown() private method

test which mouse clic is used left clic : In enemy platform put a cross if the clic touch a case Give the autorisation to a ship to move Right clic : rotate the boat
private Form1_MouseDown ( object sender, MouseEventArgs e ) : void
sender object
e MouseEventArgs
return void
        private void Form1_MouseDown(object sender, MouseEventArgs e)
        {
            switch (e.Button)
            {
                case MouseButtons.Left:
                    platEnemy.TouchedCase(e.X, e.Y);
                    if (!this.GameStarting)
                    {
                        foreach (Ship ship in ships)
                        {
                            if (ship.isBetweenCase(e.X, e.Y))
                            {
                                ship.Draggering = true;
                            }
                        }
                    }

                    break;

                case MouseButtons.Right:
                    foreach (Ship ship in ships)
                    {
                        if (ship.isBetweenCase(e.X, e.Y))
                            ship.rotateBoat();
                    }
                    break;
            }

        }