示例#1
0
 public UnderOverBet(IMatch match, IBetLine line, string mark, decimal amount, decimal coefficient, ITipster tipster) : base(match, line, mark, amount, coefficient, tipster)
 {
     this.CurrentBetType = BetType.UnderOver;
 }
示例#2
0
 public BetForFinalResult(IMatch match, IBetLine line, string mark, decimal amount, decimal coefficient, ITipster tipster) : base(match, line, mark.ToString(), amount, coefficient, tipster)
 {
     this.ResultType = ResultType.Final;
 }
示例#3
0
 public void AddTipster(int tipsterId, ITipster tipster)
 {
     this.tipsters.Add(tipsterId, tipster);
 }
示例#4
0
        public Bet(IMatch match, IBetLine line, string mark, decimal amount, decimal coefficient, ITipster tipster)
        {
            if (match == null)
            {
                throw new ArgumentNullException(string.Format(EngineConstants.ObjectCannotBeNullErrorMessage, "Match"));
            }

            if (line == null)
            {
                throw new ArgumentNullException(string.Format(EngineConstants.ObjectCannotBeNullErrorMessage, "Line"));
            }

            if (tipster == null)
            {
                throw new ArgumentNullException(string.Format(EngineConstants.ObjectCannotBeNullErrorMessage, "Tipster"));
            }

            this.Line           = line;
            this.Match          = match;
            this.Amount         = amount;
            this.Coefficient    = coefficient;
            this.CurrentBetType = currentBetType;
            this.Mark           = mark;
            this.isChecked      = false;
            this.Tipster        = tipster;

            if (this.Match.Results != null && this.Match.Results.ContainsKey(resultType))
            {
                throw new ArgumentException(EngineConstants.CannotAddBetToMatchWithResultErrorMessage);
            }

            if (this.Line.HasCompleteBet)
            {
                throw new ArgumentException(EngineConstants.AlreadyCompletedLineErrorMessage);
            }

            if (this.CalculateWinningBetAmount() > (this.Line.LeftValueToBeBet() + 0.3m))
            {
                throw new ArgumentException(EngineConstants.BetIsGreaterThenNeededErrorMessage);
            }

            this.Line.HasCompleteBet = this.IsReadyToBeComplete();

            match.AddBet(this);
            line.AddBet(this);
        }
示例#5
0
 public DoubleSignBet(IMatch match, IBetLine line, string mark, decimal amount, decimal coefficient, ITipster tipster) : base(match, line, mark, amount, coefficient, tipster)
 {
     this.CurrentBetType = BetType.DoubleSign;
 }