Beispiel #1
0
        private void btn_scr_Click(object sender, EventArgs e)
        {
            mk             = new ShuaLua("./Script/" + comboBox2.SelectedItem.ToString(), WriteLog);
            mk.onFinished += (a, b) =>
            {
                this.Invoke((MethodInvoker)(() =>
                {
                    button4.Enabled = true;
                    Change_Enable(true);
                    button5.Enabled = button6.Enabled = false;
                }));
            };
            ShuaLua sl = (ShuaLua)mk;

            sl.SetLable = (a) =>
            {
                this.Invoke((MethodInvoker)(() => { lbl_rest.Text = a.ToString(); }));
            };
            sl.ShowMsg = (a) =>
            {
                this.Invoke((MethodInvoker)(() => { MessageBox.Show(a); }));
            };
            button5.Enabled = button6.Enabled = true;
            button4.Enabled = false;
            Change_Enable(false);
            mk.Start();
        }
Beispiel #2
0
        private void button4_Click(object sender, EventArgs e)
        {
            int    sub_map, n, ot, team, hard;
            string map;

            GetStartConst(out map, out sub_map, out hard, out team, out n, out ot);

            lbl_rest.Text         = n.ToString();
            mk                    = new MaoYuKiller(n, map, sub_map, hard, team, ot);
            mk.onFinished        += Finish_Maoyu;
            mk.onOneTurnFinished += () =>
            {
                this.Invoke((MethodInvoker)(() => { lbl_rest.Text = (mk.Total - mk.Count).ToString(); }));
            };
            mk.Start();
            button4.Enabled = false;
            button5.Enabled = button6.Enabled = true;
            Change_Enable(false);
        }