Пример #1
0
        public void m_FormGameSettings_FormClosed(object sender, FormClosedEventArgs e)
        {
            if (string.IsNullOrEmpty(r_FormGameSettings.Player1Name))
            {
                r_FormGameSettings.Player1Name = "Player 1";
            }

            if (string.IsNullOrEmpty(r_FormGameSettings.Player2Name))
            {
                r_FormGameSettings.Player2Name = "Player 2";
            }

            if (r_FormGameSettings.IsPlayer2PC)
            {
                r_FormGameSettings.Player2Name = "Computer";
            }

            DetailsFilledEventArgs df = new DetailsFilledEventArgs(
                r_FormGameSettings.Player1Name,
                r_FormGameSettings.Player2Name,
                r_FormGameSettings.BoardSize,
                r_FormGameSettings.IsPlayer2PC);

            pictureBoxMatrix = new PictureBoxGameTool[r_FormGameSettings.BoardSize, r_FormGameSettings.BoardSize];
            setFormBoarders();
            createPictureBoxMatrix();
            setPlayersLabels();
            OnGameDetailsFiled(df);
        }
Пример #2
0
 protected virtual void OnGameDetailsFiled(DetailsFilledEventArgs df)
 {
     if (GameDetailsFilled != null)
     {
         GameDetailsFilled(this, df);
     }
 }
Пример #3
0
        private void m_FormGame_GameDetailsFilled(object sender, EventArgs e)
        {
            DetailsFilledEventArgs df = e as DetailsFilledEventArgs;

            m_AmericanCheckers.InitializeStartingDetails(df.GameBoardSize, df.Player1Name, df.Player2Name, df.IsPlayer2PC);
        }