private void jisuan() { #region 计算 int a = kaiju.jisuan(); List<JueSe> juese = new List<JueSe>(); int[] player = new int[3] { player1, player2, player3 }; int[] playerScore = new int[3]; int sub = 0; juese.Add(juese1); juese.Add(juese2); juese.Add(juese3); for (int i = 0; i < 3; i++) { if (juese[i].Dizhu) { if(juese[i].ShengYuPai.Count == 0) playerScore[i] += a * 2; else playerScore[i] -= a * 2; player[i] += playerScore[i]; sub = i; for (int j = 0; j < 3; j++) { if (playerScore[j] == 0) { if (playerScore[i] < 0) playerScore[j] += a; else playerScore[j] -= a; player[j] += playerScore[j]; } } break; } } player1 = player[0]; player2 = player[1]; player3 = player[2]; this.lbl_leftJiFen.Text = player3 + ""; this.lbl_rightJiFen.Text = player1 + ""; this.lbl_DownJiFen.Text = player2 + ""; #endregion #region 弹出战局窗体 string[] name = new string[3] { juese2.Player.Nickname, juese1.Player.Nickname, juese3.Player.Nickname }; int[] score = new int[3] { playerScore[1], playerScore[0], playerScore[2] }; gameOver = new GameOver(name,score); this.pic_pRight.Invoke(weituo5, 4); #endregion #region 排名 string[] playerName = new string[] { juese1.Player.Nickname, juese2.Player.Nickname, juese3.Player.Nickname }; for (int i = 0; i < player.Length; i++) { for (int j = i; j < player.Length; j++) { if (player[i] < player[j]) { int temp = player[i]; player[i] = player[j]; player[j] = temp; string temp1 = playerName[i]; playerName[i] = playerName[j]; playerName[j] = temp1; } } } string paiMing = " 1\t " + playerName[0] + "\t " + player[0]+ "\n 2\t " + playerName[1] + "\t " + player[1]+ "\n 3\t " + playerName[2] + "\t " + player[2]; txt_paiMing.Text = paiMing; #endregion #region 显示结果到聊天窗口 if (sub > 0) { int temp = playerScore[sub]; playerScore[sub] = playerScore[0]; playerScore[0] = temp; JueSe temp1 = juese[sub]; juese[sub] = juese[0]; juese[0] = temp1; } string str = txt_liaoTian.Text + "\n\n 第"+kaiju.GameNum + "局得分:\n "; string str1 = "\t"; string str2 = "\t"; if (juese[0].ShengYuPai.Count == 0) str1 = "\t "; else str2 = "\t "; str += juese[0].Player.Nickname + str1 + playerScore[0] + "\n " + juese[1].Player.Nickname + str2 + playerScore[1] + "\n " + juese[2].Player.Nickname + str2 + playerScore[2]; txt_liaoTian.Text = str; #endregion }
private void chongZhi() { if (bl_chuPaiOver) jisuan(); else { string[] name = new string[3] { juese2.Player.Nickname, juese1.Player.Nickname, juese3.Player.Nickname }; int[] score = new int[3] { 0, 0, 0 }; gameOver = new GameOver(name, score); this.pic_pRight.Invoke(weituo5, 4); } this.btn_tuoGuan.ForeColor = System.Drawing.Color.Orange; btn_tuoGuan.Text = "托管"; bl_tuoGuan = false; for (int i = 0; i < paiImage.Length; i++) { paiImage[i].Visible = false; } zhiXiangTu(0); this.pic_1.BackgroundImage = null; this.pic_2.BackgroundImage = null; this.pic_3.BackgroundImage = null; lblTiShi = null; lbl_ZhaDan.Text = ""; lbl_tiShi_D.Text = ""; lbl_tiShi_L.Text = ""; lbl_tiShi_R.Text = ""; kaiju.AllGameNum++; kaiju.Difen = 1; kaiju.Beishu = 1; bl_isDiZhu = false; bl_isFirst = false; bl_chuPaiOver = false; pic_DiZhu.Visible = false; bl_isRightTime = false; bl_isRightTime2 = false; bl_paiXu = false; buChuPai = 0; this.btn_strat.Visible = true; }