Exemple #1
0
        /// <summary>
        /// Raises the <see cref="E:PathComplete" /> event.
        /// </summary>
        /// <param name="inPathCompletionData">The <see cref="PathCompleteEventArgs"/> instance containing the event data.</param>
        private void OnPathComplete(PathCompleteEventArgs inPathCompletionData)
        {
            EventHandler <PathCompleteEventArgs> theHandler = PathComplete;

            if (theHandler != null)
            {
                theHandler(this, inPathCompletionData);
            }
        }
Exemple #2
0
 /// <summary>
 /// Detects whether the specified symbol has won.
 /// </summary>
 /// <param name="inContender">The contender.</param>
 private void DetectAWinFor(CellState inContender)
 {
     if (myCells.Count(x => x.State == inContender) == Constant.GridDimension)
     {
         // The specified contender has won.
         PathCompleteEventArgs thePathCompletionData = new PathCompleteEventArgs {
             WinningSymbol = inContender
         };
         OnPathComplete(thePathCompletionData);
     }
 }
Exemple #3
0
        /// <summary>
        /// Raises the <see cref="E:PathComplete" /> event.
        /// </summary>
        /// <param name="inPathCompletionData">The <see cref="PathCompleteEventArgs"/> instance containing the event data.</param>
        private void OnPathComplete(PathCompleteEventArgs inPathCompletionData)
        {
            EventHandler<PathCompleteEventArgs> theHandler = PathComplete;

            if (theHandler != null)
            {
                theHandler(this, inPathCompletionData);
            }
        }
Exemple #4
0
 /// <summary>
 /// Handles the PathComplete event of the GameState control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
 private void GameState_PathComplete(object sender, PathCompleteEventArgs e)
 {
     // Set the winning symbol.
     WinningSymbol = e.WinningSymbol;
 }
Exemple #5
0
 /// <summary>
 /// Detects whether the specified symbol has won.
 /// </summary>
 /// <param name="inContender">The contender.</param>
 private void DetectAWinFor(CellState inContender)
 {
     if (myCells.Count(x => x.State == inContender) == Constant.GridDimension)
     {
         // The specified contender has won.
         PathCompleteEventArgs thePathCompletionData = new PathCompleteEventArgs { WinningSymbol = inContender };
         OnPathComplete(thePathCompletionData);
     }
 }