Example #1
0
File: Path.cs Project: ggreig/OXO
        /// <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);
            }
        }
Example #2
0
File: Path.cs Project: ggreig/OXO
 /// <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);
     }
 }
Example #3
0
File: Path.cs Project: ggreig/OXO
        /// <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);
            }
        }
Example #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;
 }
Example #5
0
File: Path.cs Project: ggreig/OXO
 /// <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);
     }
 }