Example #1
0
        static void Main(string[] args)
        {
            Hashtable monster      = new Hashtable();
            var       monsterpng   = new Dictionary <string, Bitmap>();
            var       floorpng     = new Dictionary <string, Bitmap>();
            var       wallpng      = new Dictionary <string, Bitmap>();
            var       floorandwall = new Dictionary <string, string[]>();

            ReadFromFile.read(monster, monsterpng, floorpng, wallpng, floorandwall);
            Console.WriteLine("Press any key to exit.");
            System.Console.ReadKey();
        }
Example #2
0
        private void openFileToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //MEMBACA FILE dari openfiledialog
            DialogResult hasil = openFileDialog1.ShowDialog();

            textBox1.Text = openFileDialog1.FileName;

            if (!File.Exists(textBox1.Text))
            {
                //Jika file tidak ditemukan
                MessageBox.Show("File not found");
            }
            else
            {
                //file ditemukan
                button6.Enabled   = true;
                richTextBox1.Text = "";
                ReadFromFile inputanFile = new ReadFromFile();

                //Proses load output file ke rich textbox
                inputanFile.read(textBox1.Text, out resultGraph, out pemetaanIndex);
                foreach (KeyValuePair <int, string> entry in pemetaanIndex)
                {
                    richTextBox1.Text = richTextBox1.Text + entry.Key.ToString() + " = " + entry.Value + "\r\n";
                }

                for (int i = 0; i < resultGraph.getSize(); i++)
                {
                    string temp = "";
                    for (int j = 0; j < resultGraph.getSize(); j++)
                    {
                        temp = temp + (resultGraph.isAdjacent(i, j) ? 1.ToString() : 0.ToString()) + " ";
                    }
                    temp = temp + "\r\n";
                    richTextBox1.Text = richTextBox1.Text + temp;
                }
            }
        }