/// <summary> /// Gets message from sender /// </summary> /// <param name="sender">Message sender</param> /// <param name="eventArgs">Message arguments</param> private void PlayerMsg(object sender, RouletteEventArgs eventArgs) { Console.WriteLine("Winner combination: {0} - {1}", eventArgs.Color, eventArgs.Number); if (eventArgs.Color == this.Color || eventArgs.Number == this.Number) { Console.WriteLine("I'm a winner!"); } else { Console.WriteLine("Better luck next time."); } }
/// <summary> /// Sends new message to subscribers /// </summary> /// <param name="sender">Message sender</param> /// <param name="e">Message arguments</param> protected virtual void OnNewMsg(object sender, RouletteEventArgs e) { NewMessage?.Invoke(sender, e); }