예제 #1
0
파일: Main.cs 프로젝트: RuiziLuigi/Reversi
        /// <summary>
        /// 終了処理
        /// </summary>
        private void finProc()
        {
            int iWhite = 0, iBlack = 0;

            // 集計後
            this.m_proc.TotalProc(getViewColor(), out iWhite, out iBlack);
            this.startButton.Text  = "R e s e t";
            this.m_playState       = Proc.PlayState.End;
            this.skpButton.Enabled = false;
            this.turnLabel.Text    = "白:" + iWhite.ToString() + " 黒:" + iBlack.ToString();
        }
예제 #2
0
파일: Main.cs 프로젝트: RuiziLuigi/Reversi
        /// <summary>
        /// 開始ボタン押下時
        /// </summary>
        /// <remarks>
        /// 開始ボタン押下時の処理
        /// </remarks>
        /// <param name="sender">オブジェクト</param>
        /// <param name="e">イベント</param>
        private void startButton_Click(object sender, EventArgs e)
        {
            if (this.m_playState == Proc.PlayState.None)
            {
                // メッセージを表示したのち、
                // 開始状態にする
                for (int iX = 0; iX < this.m_lstCircle.GetLength(0); iX++)
                {
                    for (int iY = 0; iY < this.m_lstCircle.GetLength(1); iY++)
                    {
                        this.m_lstCircle[iX, iY].Reset();
                    }
                }
                // 座標(4, 4)(5, 5)に白、(4, 5)(5, 4)に黒の石を設定する
                this.m_lstCircle[3, 3].InitView(Proc.ViewColor.White);
                this.m_lstCircle[4, 4].InitView(Proc.ViewColor.White);
                this.m_lstCircle[3, 4].InitView(Proc.ViewColor.Black);
                this.m_lstCircle[4, 3].InitView(Proc.ViewColor.Black);

                // 初回ターンは白から
                this.m_proc._Turn   = Proc.Turn.Black;
                this.turnLabel.Text = this.m_proc.ReverseTurn();
                // ボタン文字変更
                this.startButton.Text  = "E  n  d";
                this.m_playState       = Proc.PlayState.Play;
                this.skpButton.Enabled = true;
            }
            else if (this.m_playState == Proc.PlayState.Play)
            {
                // 終了処理
                finProc();
            }
            else if (this.m_playState == Proc.PlayState.End)
            {
                // 全クリア
                for (int iX = 0; iX < this.m_lstCircle.GetLength(0); iX++)
                {
                    for (int iY = 0; iY < this.m_lstCircle.GetLength(1); iY++)
                    {
                        this.m_lstCircle[iX, iY].Reset();
                    }
                }
                this.startButton.Text  = "S t a r t";
                this.m_playState       = Proc.PlayState.None;
                this.skpButton.Enabled = true;
                this.turnLabel.Text    = "";
            }
        }