private void btn_submit_Click(object sender, EventArgs e)
        {
            bool isValid = ValidateForm();

            if (isValid)
            {
                PointMethod allPointsMethods = new PointMethod();

                NewPoint = new Classes.Point();
                NewPoint.MethodScored = ((Method)cmb_allScoringMethods.SelectedItem).MethodScored;
                NewPoint.PointValue   = ((Method)cmb_allScoringMethods.SelectedItem).Value;
                NewPoint.HomeScored   = (rad_homeWrestler.Checked == true) ? true : false;
                NewPoint.HomeWrestler = new Wrestler(CurrentHomeWrestler);
                NewPoint.AwayWrestler = new Wrestler(CurrentAwayWrestler);

                if (VideoDirectory != null)
                {
                    NewPoint.VideoDirectory = VideoDirectory;
                }
                else
                {
                    NewPoint.VideoDirectory = "novideo";
                }
                this.Close();
            }
            else
            {
                MessageBox.Show("Please select a wrestler and a point method");
            }
        }
Пример #2
0
        static void doWork()
        {
            Point  origin      = new Classes.Point();
            Point  bottomRight = new Classes.Point(1366, 768);
            double distance    = origin.DistanceTo(bottomRight);

            Console.WriteLine($"Distance is: {distance}");
            Console.WriteLine($"Numer of point objects: {Point.ObjectCount()}");
        }
        private void btn_cancel_Click(object sender, EventArgs e)
        {
            DialogResult result = MessageBox.Show("Are you sure you would like to exit?", "Exit Point", MessageBoxButtons.YesNo);

            if (result == DialogResult.Yes)
            {
                NewPoint = null;
                this.Close();
            }
        }
 public LevelCreation()
 {
     this.InitializeComponent();
     InitializeComboBoxes();
     _selectedImage            = new Image();
     _selectefGameObject       = new GameObject();
     _isMousePressed           = false;
     _playerPositionMarkerFlag = false;
     _playerMarkerPosition     = new Classes.Point();
     Map = new Map(canvas, "/Assets/Backgrounds/White.jpg", new Classes.Point(), 0, true);
 }
Пример #5
0
        private void NextInput()
        {
            Classes.Point punto = new Classes.Point();
            switch (stratCBox.SelectedIndex)
            {
            case 1:
                punto = strategy.Random();
                break;

            case 2:
                punto = strategy.Spiral();
                break;

            case 3:
                punto = strategy.Quadrantes(Classes.Globals.Offense, 10, 0, 0);
                break;
            }

            textBox1.Text = punto.X.ToString() + "," + punto.Y.ToString();
        }
Пример #6
0
 private void fireButton_Click(object sender, EventArgs e)
 {
     try
     {
         DialogResult dialogResult = MessageBox.Show("acerto el tiro?", "ATENCION", MessageBoxButtons.YesNo);
         if (dialogResult == DialogResult.Yes)
         {
             Classes.Globals.Offense.setValue(Convert.ToInt32(xBox.Text), Convert.ToInt32(yBox.Text), 2);
             dialogResult = DialogResult.No;
             Classes.Point punto    = new Classes.Point();
             Classes.Point acertado = new Classes.Point(Convert.ToInt32(xBox.Text), Convert.ToInt32(yBox.Text));
             int           x        = 1;
             char          c;
             Classes.Point regreso = new Classes.Point(Convert.ToInt32(xBox.Text), Convert.ToInt32(yBox.Text));
             while (dialogResult != DialogResult.Yes)
             {
                 if (x == 1)
                 {
                     c = 'R';
                 }
                 else if (x == 2)
                 {
                     c = 'L';
                 }
                 else if (x == 3)
                 {
                     c = 'U';
                 }
                 else
                 {
                     c = 'D';
                 }
                 punto         = strategy.Hunt(acertado, c);
                 textBox1.Text = punto.X.ToString() + "," + punto.Y.ToString();
                 DialogResult d = MessageBox.Show("acerte?");
                 if (d == DialogResult.Yes)
                 {
                     acertado = punto;
                 }
                 else if (x == 4)
                 {
                     x        = 1;
                     acertado = regreso;
                 }
                 else
                 {
                     x++;
                 }
                 dialogResult = MessageBox.Show("lo derribe?", "ATENCION", MessageBoxButtons.YesNo);
             }
         }
         else
         {
             Classes.Globals.Offense.setValue(Convert.ToInt32(xBox), Convert.ToInt32(yBox), 1);
         }
         NextInput();
     }
     catch
     {
         if (xBox.Text == "" && yBox.Text == "")
         {
             MessageBox.Show("Falta información");
         }
         else
         {
             MessageBox.Show("Escribir solo números");
         }
     }
 }
Пример #7
0
 private void fireButton_Click(object sender, EventArgs e)
 {
     if (myTurn())
     {
         try
         {
             TurnoLabel.Text = "Maquina";
             DialogResult dialogResult = MessageBox.Show("acerto el tiro?", "ATENCION", MessageBoxButtons.YesNo);
             if (dialogResult == DialogResult.Yes)
             {
                 Classes.Globals.Offense.setValue(Convert.ToInt32(xBox.Text), Convert.ToInt32(yBox.Text), 2);
                 dialogResult = DialogResult.No;
                 Classes.Point punto    = new Classes.Point();
                 Classes.Point acertado = new Classes.Point(Convert.ToInt32(xBox.Text), Convert.ToInt32(yBox.Text));
                 int           x        = 1;
                 char          c;
                 Classes.Point regreso = new Classes.Point(Convert.ToInt32(xBox.Text), Convert.ToInt32(yBox.Text));
                 while (dialogResult != DialogResult.Yes)
                 {
                     if (x == 1)
                     {
                         c = 'R';
                     }
                     else if (x == 2)
                     {
                         c = 'L';
                     }
                     else if (x == 3)
                     {
                         c = 'U';
                     }
                     else
                     {
                         c = 'D';
                     }
                     punto         = strategy.Hunt(acertado, c);
                     textBox1.Text = punto.X.ToString() + "," + punto.Y.ToString();
                     DialogResult d = MessageBox.Show("acerte?");
                     if (d == DialogResult.Yes)
                     {
                         acertado = punto;
                     }
                     else if (x == 4)
                     {
                         x        = 1;
                         acertado = regreso;
                     }
                     else
                     {
                         x++;
                     }
                     dialogResult = MessageBox.Show("lo derribe?", "ATENCION", MessageBoxButtons.YesNo);
                 }
                 //meter el metodo del mensaje
             }
             else
             {
                 Classes.Globals.Offense.setValue(Convert.ToInt32(xBox.Text), Convert.ToInt32(yBox.Text), 1);
             }
             //metodo a llamar mensaje que pida los las xis y ys que esta tirando el contrincante
             NextInput();
         }
         catch (Exception ex)
         {
             //if (xBox.Text == "" && yBox.Text == "")
             //    MessageBox.Show("Falta información");
             //else
             //    MessageBox.Show("Escribir solo números");
             MessageBox.Show(ex.Message);
         }
     }
     else
     {
         TurnoLabel.Text = "Humano";
         if (Classes.Globals.Defense.Value(Convert.ToInt32(xBox.Text), Convert.ToInt32(yBox.Text)) == -1)
         {
             Classes.Globals.Defense.setValue(Convert.ToInt32(xBox.Text), Convert.ToInt32(yBox.Text), 2);
         }
         else
         {
             Classes.Globals.Defense.setValue(Convert.ToInt32(xBox.Text), Convert.ToInt32(yBox.Text), 1);
         }
     }
     this.Refresh();
 }
Пример #8
0
        private void MatchButtonClick(object sender, EventArgs e)
        {
            List<Minutia> minutiasFrom = GetMinutiasFrom(ImageFrom);

            MessageBox.Show("Found " + minutiasFrom.Count + " minutias in left picture.");

            List<Classes.Point> pointsFrom = new List<Classes.Point>();
            Graphics ImageFromGraphics = ImageFrom.CreateGraphics();
            foreach (Minutia m in minutiasFrom)
            {
                Classes.Point p = new Classes.Point(m.X, ImageFrom.Height - m.Y+1);
                p.Paint(ImageFromGraphics, defPointPen, ImageFrom.Height);
                pointsFrom.Add(p);
            }

            if (minutiasFrom.Count > 500)
            {
                string messageBoxText = "Do you really want to continue?\n You'll just waste your time...";
                string caption = "Too many minutuias";
                MessageBoxButtons mb = MessageBoxButtons.OKCancel;
                if (MessageBox.Show(messageBoxText, caption, mb) == System.Windows.Forms.DialogResult.Cancel)
                    return;
            }

            Classes.TriangulationBuilder tb = new Classes.TriangulationBuilder(pointsFrom);
            MessageBox.Show("Triangulation built! It has: "+tb.triangles.Count+" triangles.");

            List<Classes.Triangle> triangulationFrom = tb.triangles;
            foreach (Classes.Triangle t in tb.triangles) {
                t.Paint(ImageFromGraphics, defLinePen, defPointPen, ImageFrom.Height);
            }

            List<Minutia> minutiasTo = GetMinutiasFrom(ImageTo);

            MessageBox.Show("Found " + minutiasTo.Count + " minutias in right picture");

            List<Classes.Point> pointsTo = new List<Classes.Point>();

            Graphics ImageToGraphics = ImageTo.CreateGraphics();
            foreach (Minutia m in minutiasTo)
            {
                Classes.Point p = new Classes.Point(m.X, ImageTo.Height - m.Y+1);
                p.Paint(ImageToGraphics, defPointPen, ImageTo.Height);
                pointsTo.Add(p);
            }

            if (minutiasTo.Count > 500)
            {
                string messageBoxText = "Do you really want to continue?\n You'll just waste your time...";
                string caption = "Too many minutuias";
                MessageBoxButtons mb = MessageBoxButtons.OKCancel;
                if (MessageBox.Show(messageBoxText, caption, mb) == System.Windows.Forms.DialogResult.Cancel)
                    return;
            }

            Classes.TriangulationBuilder tbTo;
            if (minutiasTo.Count < 500)
                tbTo = new Classes.TriangulationBuilder(pointsTo);
            else
                tbTo = new Classes.TriangulationBuilder(pointsTo, ImageToGraphics, defLinePen, defPointPen, new Pen(Color.Gold, 1), ImageTo.Height, 0);

            MessageBox.Show("Triangulation built! It has: " + tbTo.triangles.Count + " triangles.");

            List<Classes.Triangle> triangulationTo = tbTo.triangles;
            foreach (Classes.Triangle t in tbTo.triangles)
            {
                t.Paint(ImageToGraphics, defLinePen, defPointPen, ImageFrom.Height);
            }

            Classes.TriangulationsMatcher tm = new Classes.TriangulationsMatcher(triangulationFrom, triangulationTo);
            double[] result = tm.Match(0.001,90);
            MessageBox.Show("Equals: " + result[0] + ", very close:" + result[1]);
        }