private void move(int nextPos) { if (person.Location != 10) { String direction = client.move(nextPos); string[] directionStrings = direction.Substring(1, direction.Length - 2).Split(','); for (int i = 0; i < directionStrings.Length; i++) { currentPotentialPos[i] = Convert.ToInt32(directionStrings[i]); Console.WriteLine("We can go to:" + directionStrings[i]); } // TOP BOTTOM RIGHT LEFT button3.Enabled = false; button1.Enabled = false; button2.Enabled = false; button4.Enabled = false; button5.Enabled = false; if (Convert.ToInt32(directionStrings[0]) != -1) { button1.Enabled = true; } if (Convert.ToInt32(directionStrings[1]) != -1) { button3.Enabled = true; } if (Convert.ToInt32(directionStrings[2]) != -1) { button2.Enabled = true; } if (Convert.ToInt32(directionStrings[3]) != -1) { button4.Enabled = true; } Console.WriteLine("We are at:" + person.Location); richTextBox1.Text += Environment.NewLine + client.getStory(person.Location); try { enemy enemy = client.isEnemy(person.Location); if (enemy != null && !deadEnemies.Contains(enemy)) { button5.Enabled = true; button3.Enabled = false; button1.Enabled = false; button2.Enabled = false; button4.Enabled = false; fight = new Fight(person, enemy, this); } Console.WriteLine(enemy.name.ToString()); } catch (Exception e) { //MessageBox.Show(e.Message); } } else { MessageBox.Show("You found the treasure"); } }