public void PlayBack(Game GameToPlayBack) { PlayBackStatus = true; PlaybackGame = GameToPlayBack; Dual.Add(GameToPlayBack.Control.Practice()); Dual[NumbersOfGame].Paint.Drawboard(); NumbersOfGame++; for (int i = 0; i < Dual.Count; i++) { if (Dual[i].Equals(GameToPlayBack)) { AttemptationIndexArray[NumbersOfGame] = i; } } //AttemptationIndexArray[NumbersOfGame] AttemptationStatus = true; Recover.Visible = false; Recover.Enabled = false; Attemptation.Visible = false; //ReStart.Visible = false; //ReStart.Enabled = false; Next.Visible = true; Next.Enabled = true; Previous.Visible = true; Previous.Enabled = true; CommentBox.Visible = true; Comment.Visible = true; Comment.Enabled = true; CommentBox.Enabled = true; CommentBox.Text = GameToPlayBack.Comments[GameToPlayBack.InitialStep]; }
private void Attemptation_Click(object sender, EventArgs e) { if (!AttemptationStatus) { AttemptationStatus = true; Attemptation.Text = "END"; CommentBox.Visible = true; CommentBox.Enabled = true; Comment.Enabled = true; Comment.Visible = true; Dual.Add(Dual[NumbersOfGame].Control.Practice()); AttemptationIndexArray[NumbersOfGame + 1] = NumbersOfGame; NumbersOfGame++; Invalidate(); } else if (AttemptationStatus) { Recover.Visible = true; Recover.Enabled = true; AttemptationStatus = false; Attemptation.Text = "Attempt"; Dual.Add(Dual[AttemptationIndexArray[NumbersOfGame]]); NumbersOfGame++; Invalidate(); //Dual[NumbersOfGame].Paint.Drawboard(); //Dual[NumbersOfGame].Paint.Drawchess(Dual[NumbersOfGame].Black); //Dual[NumbersOfGame].Paint.Drawchess(Dual[NumbersOfGame].White); } }
private void button1_Click(object sender, EventArgs e) { if (!AttemptationStatus) { NumbersOfGame++; Condition = true; Dual.Add(new Game(Vertex, SizePerLine, this)); Dual[NumbersOfGame].Paint.Drawboard(); Invalidate(); } else { Dual.Add(Dual[AttemptationIndexArray[NumbersOfGame]].Control.Practice()); AttemptationIndexArray[NumbersOfGame + 1] = AttemptationIndexArray[NumbersOfGame]; NumbersOfGame++; Dual[AttemptationIndexArray[NumbersOfGame]].Paint.Drawchess(Dual[NumbersOfGame].Black); Dual[AttemptationIndexArray[NumbersOfGame]].Paint.Drawchess(Dual[NumbersOfGame].White); Invalidate(); } }//restart
private void DualPlayer_MouseClick(object sender, MouseEventArgs e) { if (!AttemptationStatus) { if (Condition) { int ocassion = Dual[NumbersOfGame].Control.Put(e.Location);//判断是否继续游戏 if (ocassion == 1) { NumbersOfGame++; Dual.Add(new Game(Vertex, SizePerLine, this)); } if (ocassion == -1) { Condition = false; //MessageBox.Show({"The Score if "+Score[0].ToString()+" : "+Score[1].ToString(), FinalScore); } } } if (AttemptationStatus) { if (Condition) { int ocassion = Dual[NumbersOfGame].Control.Put(e.Location); Dual[NumbersOfGame].Paint.DrawchessWithNumber(Dual[NumbersOfGame]); if (ocassion == 1) { NumbersOfGame++; Dual[NumbersOfGame].Paint.Drawboard(); Dual[NumbersOfGame].Paint.Drawchess(Dual[NumbersOfGame].Black); Dual[NumbersOfGame].Paint.Drawchess(Dual[NumbersOfGame].White); Dual.Add(Dual[AttemptationIndexArray[NumbersOfGame]].Control.Practice()); } if (ocassion == -1) { Condition = false; } } } }