Esempio n. 1
0
        public void RemoveBettingLine(IBetLine betLine)
        {
            if (betLine == null)
            {
                throw new ArgumentNullException(string.Format(EngineConstants.ObjectCannotBeNullErrorMessage, "Line"));
            }

            if (this.BettingLines.Contains(betLine))
            {
                this.BettingLines.Remove(betLine);
            }
        }
Esempio n. 2
0
        public void AddBettingLine(IBetLine betLine)
        {
            if (betLine == null)
            {
                throw new ArgumentNullException(string.Format(EngineConstants.ObjectCannotBeNullErrorMessage, "Line"));
            }

            if (this.BettingLines.Contains(betLine))
            {
                throw new ArgumentException(EngineConstants.SameLinesToAnAcountErrorMessage);
            }

            this.bettingLines.Add(betLine);
        }
Esempio n. 3
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);
        }
Esempio n. 4
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;
 }
Esempio n. 5
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;
 }
Esempio n. 6
0
 public void AddLine(int lineId, IBetLine line)
 {
     this.lines.Add(lineId, line);
     this.linesData.Add(line.Name, line);
 }
Esempio n. 7
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;
 }