예제 #1
0
        private void button5_Click(object sender, EventArgs e)
        {
            Addition  addition    = new Addition();
            AlgRandom algGenerate = new AlgRandom();

            switch (algIndex)
            {
            case 0:
                map = addition.Add(map, algGenerate.Generate(Int32.Parse(textBox1.Text)));
                DisplacementMap.Image = map;
                break;

            case 1:
                AlgPerlin perlin = new AlgPerlin();
                map = addition.AddPerlin(map, perlin.Generate(Int32.Parse(textBox1.Text), Int32.Parse(textBox1.Text)));
                DisplacementMap.Image = map;
                break;
            }

            listBox1.Items.Add($"X = {Int32.Parse(textBox1.Text)}; Y = {Int32.Parse(textBox1.Text)}");
            listBox1.Items.Add("");


            DisplacementMap.Image = map;
        }
예제 #2
0
        internal void Generate_Click(object sender, EventArgs e)
        {
            listBox1.Items.Clear();
            switch (algIndex)
            {
            case 0:
                AlgRandom algGenerate = new AlgRandom();
                map = algGenerate.Generate(Int32.Parse(textBox1.Text));
                DisplacementMap.Image = map;
                break;

            case 1:
                AlgPerlin perlin = new AlgPerlin();
                map = perlin.Generate(Int32.Parse(textBox1.Text), Int32.Parse(textBox1.Text));
                DisplacementMap.Image = map;
                break;
            }
            listBox1.Items.Add($"X = {Int32.Parse(textBox1.Text)}; Y = {Int32.Parse(textBox1.Text)}");
            listBox1.Items.Add("");
        }