예제 #1
0
        /// <summary>
        /// Fires when the rolling of a dice is finished
        /// </summary>
        /// <param name="e">The dice event arguments</param>
        protected virtual void OnRollingFinished(RollingDiceEventArgs e)
        {
            EventHandler<RollingDiceEventArgs> handler = RollingFinish;

            // Event will be null if there are no subscribers
            if (handler != null)
            {
                // Use the () operator to raise the event.
                handler(this, e);
            }
        }
예제 #2
0
 /// <summary>
 /// Is called, when the dice of the enemy finished rolling
 /// </summary>
 /// <param name="sender">The rolled dice</param>
 /// <param name="e">The dice event arguments</param>
 void partnersDice_RollingFinish(object sender, RollingDiceEventArgs e)
 {
     this.PartnerDice = e.Value;
     CheckDiceWinner();
 }
예제 #3
0
 /// <summary>
 /// Is called, when a dice roll of the enemy is received
 /// </summary>
 /// <param name="sender">The sender</param>
 /// <param name="e">The dice event arguments</param>
 void XmppManager_IncomingDiceroll(object sender, RollingDiceEventArgs e)
 {
     // Roll the dice of the enemy with the received value
     if (FooterMenu.Dices[1] != null)
     {
         Deployment.Current.Dispatcher.BeginInvoke(delegate
         {
             FooterMenu.Dices[1].Roll(e.Value);
         }
         );
     }
     else
     {
         // Store the Value for use it later
         this.PartnersPreDice = e.Value;
     }
 }
예제 #4
0
 /// <summary>
 /// Is called, when the onw dice finished rolling
 /// Sends the result to the partner and checks, if a winner is already available
 /// </summary>
 /// <param name="sender">The rolled dice</param>
 /// <param name="e">The dice event arguments</param>
 void dice_RollingFinish(object sender, RollingDiceEventArgs e)
 {
     this.OwnDice = e.Value;
     Partner.Dice(e.Value);
     CheckDiceWinner();
 }