Beispiel #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);
            }
        }
Beispiel #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);
     }
 }
Beispiel #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);
            }
        }
Beispiel #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;
 }
Beispiel #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);
     }
 }