private void button1_Click(object sender, EventArgs e) { string to = null; if (sender is Button) { Button button = sender as Button; richTextBox1.Text = button.Tag.ToString(); if (from == null) { from = button.Tag.ToString(); } else { to = button.Tag.ToString(); } if (prevoiusButton == null) { prevoiusButton = button; } else { gamePresenter.ManualTurn(prevoiusButton.Tag as Position, button.Tag as Position); prevoiusButton = null; } } }
public void WaitForTurn() { Console.WriteLine(); Console.WriteLine("Ön jön! Így adja meg a lépését pl.:B2 C3"); string nextMove = Console.ReadLine(); Position[] poses = ParseCoordinates(nextMove); if (poses != null) { presenter.ManualTurn(poses[0], poses[1]); } else { ShowError("Nagyon hibás paraméter"); WaitForTurn(); } }