public void CloseBetOnForcedEnd(object sender, ForcedEndMatchEventArgs args) { if (sender == this.Match && !this.BetClosed) { if ((args.Winner == this.Match.Away && this.BetOnResult == DrawNotPossibleResults.WinAway) || (args.Winner == this.Match.Home && this.BetOnResult == DrawNotPossibleResults.WinHome)) { this.AmountWon = (this.Match.Coefficients[(int)this.BetOnResult] - 1) * this.BetAmnout; this.BetClosed = true; Console.WriteLine("The bet({0}) for ({1}) has been closed due to {4} for {5}. You win {2:C} above your bet amount({3:C})!", this.ID, this.Match.ID, this.AmountWon, this.BetAmnout, args.Message, args.Winner); } else { Console.WriteLine("The bet({0}) for ({1}) has been closed due to {3} for {4}. You have lost your bet amount({2:C})!", this.ID, this.Match.ID, this.BetAmnout, args.Message, args.Winner); } } }
static void PrintForcedEndOfMatchEvent(object sender, ForcedEndMatchEventArgs args) { Console.WriteLine("{0} has won with {1} against {2}", args.Winner, args.Message, (args.Winner == args.Home) ? args.Away : args.Home); }