Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OddsGeneration"/> class
        /// </summary>
        /// <param name="oddsGenerationProperties">The odds generation properties</param>
        public OddsGeneration(oddsGenerationProperties oddsGenerationProperties)
        {
            Guard.Argument(oddsGenerationProperties, nameof(oddsGenerationProperties)).NotNull();

            ExpectedTotals = oddsGenerationProperties.expected_totalsSpecified
                                 ? oddsGenerationProperties.expected_totals
                                 : (double?)null;
            ExpectedSupremacy = oddsGenerationProperties.expected_supremacySpecified
                                    ? oddsGenerationProperties.expected_supremacy
                                    : (double?)null;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="OddsGeneration"/> class
        /// </summary>
        /// <param name="oddsGenerationProperties">The odds generation properties</param>
        public OddsGeneration(oddsGenerationProperties oddsGenerationProperties)
        {
            Contract.Requires(oddsGenerationProperties != null);

            ExpectedTotals = oddsGenerationProperties.expected_totalsSpecified
                                 ? oddsGenerationProperties.expected_totals
                                 : (double?)null;
            ExpectedSupremacy = oddsGenerationProperties.expected_supremacySpecified
                                    ? oddsGenerationProperties.expected_supremacy
                                    : (double?)null;
        }
        /// <summary>Initializes a new instance of the <see cref="OddsChange{T}" /> class</summary>
        /// <param name="timestamp">The value specifying timestamps related to the message (in the milliseconds since EPOCH UTC)</param>
        /// <param name="producer">The <see cref="IProducer" /> specifying the producer / service which dispatched the current <see cref="Message" /> message</param>
        /// <param name="event">An <see cref="ICompetition" /> derived instance representing the sport event associated with the current <see cref="EventMessage{T}" /></param>
        /// <param name="requestId">The id of the request which triggered the current <see cref="EventMessage{T}" /> message or a null reference</param>
        /// <param name="changeReason">a <see cref="EventMessage{T}" /> member specifying the reason for the odds change</param>
        /// <param name="betStopReason">the <see cref="BetStopReason" /> enum member specifying the reason for betting being stopped, or a null reference if the reason is not known</param>
        /// <param name="bettingStatus">a <see cref="BettingStatus"/> enum indicating whether the betting should be allowed</param>
        /// <param name="markets">An <see cref="IMarketMessage{T,T1}" /> describing markets associated with the current <see cref="IMarketMessage{T, R}" /></param>
        /// <param name="oddsGenerationProperties">Provided by the prematch odds producer only, and contains a few key-parameters that can be used in a client’s own special odds model, or even offer spread betting bets based on it</param>
        /// <param name="namedValuesProvider">The <see cref="INamedValuesProvider"/> used to provide names for betting status and bet stop reason</param>
        /// <param name="rawMessage">The raw message</param>
        public OddsChange(IMessageTimestamp timestamp, IProducer producer, T @event, long?requestId, OddsChangeReason?changeReason, int?betStopReason, int?bettingStatus, IEnumerable <IMarketWithOdds> markets, oddsGenerationProperties oddsGenerationProperties, INamedValuesProvider namedValuesProvider, byte[] rawMessage)
            : base(timestamp, producer, @event, requestId, markets, rawMessage)
        {
            Guard.Argument(namedValuesProvider, nameof(namedValuesProvider)).NotNull();

            _namedValueProvider      = namedValuesProvider;
            ChangeReason             = changeReason;
            _betStopReason           = betStopReason;
            _bettingStatus           = bettingStatus;
            OddsGenerationProperties = oddsGenerationProperties == null
                                           ? null
                                           : new OddsGeneration(oddsGenerationProperties);
        }