コード例 #1
0
 public override void CloseBetAfterEnd(object sender, EndMatchEventArgs 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 match ending with {2:C} win above your bet amount({3:C})!", this.ID, this.Match.ID, this.AmountWon, this.BetAmnout);
         }
         else
         {
             Console.WriteLine("The bet({0}) for ({1}) has been closed due to match ending. You have lost your bet amount({2:C})!", this.ID, this.Match.ID, this.BetAmnout);
         }
     }
 }
コード例 #2
0
        public override void CloseBetAfterEnd(object sender, EndMatchEventArgs args)
        {
            if (sender == this.Match && !this.BetClosed)
            {
                if ((args.Winner == this.Match.Away &&
                     (this.BetOnResult & DrawPossibleResults.WinAway) == DrawPossibleResults.WinAway) ||
                    (args.Winner == this.Match.Home &&
                     (this.BetOnResult & DrawPossibleResults.WinHome) == DrawPossibleResults.WinHome) ||
                    (args.Winner == EndMatchEventArgs.noWinner &&
                     (this.BetOnResult & DrawPossibleResults.Draw) == DrawPossibleResults.Draw))
                {
                    decimal[] arrCoef = ReorderCoefToPossibleResults();

                    this.AmountWon = (arrCoef[(int)this.BetOnResult - 1] - 1) * this.BetAmnout;
                    this.BetClosed = true;
                    Console.WriteLine("The bet({0}) for ({1}) has been closed due to match ending with {2:C} win above your bet amount({3:C})!", this.ID, this.Match.ID, this.AmountWon, this.BetAmnout);
                }
                else
                {
                    Console.WriteLine("The bet({0}) for ({1}) has been closed due to match ending. You have lost your bet amount({2:C})!", this.ID, this.Match.ID, this.BetAmnout);
                }
            }
        }
コード例 #3
0
 static void PrintEndOfMatchEvent(object sender, EndMatchEventArgs args)
 {
     Console.WriteLine("{0} has won! The result of match {1} vs {2} is {3} : {4}", args.Winner, args.Home, args.Away, args.ScoredHome, args.ScoredAway);
 }
コード例 #4
0
 public abstract void CloseBetAfterEnd(object sender, EndMatchEventArgs args);