コード例 #1
0
        private void buttonpl_Click(object sender, RoutedEventArgs e)
        {
            int x, y;

            try
            {
                if (Int32.TryParse(textBoxx.Text, out x) && Int32.TryParse(textBoxy.Text, out y))
                {
                    var move = new MikMak.Commons.Move()
                    {
                        PlayerNumber = currentSession.PlayerNumber,
                        Positions    = new List <MikMak.Commons.Pawn>()
                        {
                            new MikMak.Commons.Pawn('e', x, y)
                        }
                    };
                    var d = manager.Play(currentSession, move);
                    //Play("test", move);
                    ShowResult(d);
                }
                else
                {
                    this.textBox1.Text = "Err of parsing";
                }
            }
            catch (Exception u)
            {
                MessageBox.Show("Exception : " + u.ToString());
            }
        }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: Paraintom/MikMak
        private void buttonpl_Click(object sender, RoutedEventArgs e)
        {
            int  x, y;
            try
            {
                if (Int32.TryParse(textBoxx.Text, out x) && Int32.TryParse(textBoxy.Text, out y))
                {
                    var move = new MikMak.Commons.Move()
                    {
                        PlayerNumber = currentSession.PlayerNumber,
                        Positions = new List<MikMak.Commons.Pawn>(){
                        new MikMak.Commons.Pawn('e', x , y)
                    }
                    };
                    var d = manager.Play(currentSession, move);
                    //Play("test", move);
                    ShowResult(d);

                }
                else
                {
                    this.textBox1.Text = "Err of parsing";
                }
            }
            catch (Exception u)
            {
                MessageBox.Show("Exception : " + u.ToString());
            }
        }