using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Selection
{
    public partial class Form1 : Form
    {
        Individual[] gen1, gen2;    int size = 3;
        int width, height;          Image targetImage;

        public Form1()
        {
            InitializeComponent();
            pbTarget.Image = Image.FromFile("C:\\Users\\alexa\\OneDrive\\Desktop\\Capstone26\\code\\genetic algorithm\\selection\\Selection\\balloons.bmp");

            targetImage = pbTarget.Image;       width = pbTarget.Image.Width;       height = pbTarget.Image.Height;
            gen1 = new Individual[size];
            for(int i = 0; i < size; i++)
            {
                gen1[i] = new Individual(width, height, targetImage); 
            }
        }
        private void sortClick(object sender, EventArgs e)
        {
            Console.WriteLine("entering btnClick...");
            for (int i = 0; i < size; i++)
            {
                Console.WriteLine("score" + i + " " + gen1[i].Score);
            }
            Array.Sort(gen1, (x, y) => x.Score.CompareTo(y.Score));   //sorts from least to greatest
            Console.WriteLine("after the sort...");
            for (int i = 0; i < size; i++)
            {
                Console.WriteLine("score" + i + " " + gen1[i].Score);
            }
        }
        private void nextClick(object sender, EventArgs e)
        {

        }
    }
}
