Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PitcherCI"/> class
 /// </summary>
 /// <param name="exportable">A <see cref="ExportablePitcherCI"/> containing information about the pitcher</param>
 internal PitcherCI(ExportablePitcherCI exportable)
     : base(URN.Parse(exportable.Id))
 {
     Name       = exportable.Name;
     Hand       = exportable.Hand;
     Competitor = exportable.Competitor;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Pitcher"/> class
 /// </summary>
 /// <param name="cacheItem">A <see cref="PitcherCI"/> used to create new instance</param>
 internal Pitcher(PitcherCI cacheItem)
 {
     Id         = cacheItem.Id;
     Name       = cacheItem.Name;
     Hand       = cacheItem.Hand;
     Competitor = cacheItem.Competitor;
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Merges the provided information about the current pitcher
        /// </summary>
        /// <param name="pitcher">A <see cref="PitcherDTO"/> containing pitcher info</param>
        /// <param name="culture">A <see cref="CultureInfo"/> specifying the language of the pitcher info</param>
        internal void Merge(PitcherDTO pitcher, CultureInfo culture)
        {
            Guard.Argument(pitcher, nameof(pitcher)).NotNull();
            Guard.Argument(culture, nameof(culture)).NotNull();

            Name       = pitcher.Name;
            Hand       = pitcher.Hand;
            Competitor = pitcher.Competitor;
        }
Ejemplo n.º 4
0
        /// <summary>
        ///     Merges the provided information about the current pitcher
        /// </summary>
        /// <param name="pitcher">A <see cref="PitcherDTO" /> containing pitcher info</param>
        /// <param name="culture">A <see cref="CultureInfo" /> specifying the language of the pitcher info</param>
        internal void Merge(PitcherDTO pitcher, CultureInfo culture)
        {
            Contract.Requires(pitcher != null);
            Contract.Requires(culture != null);

            Name       = pitcher.Name;
            Hand       = pitcher.Hand;
            Competitor = pitcher.Competitor;
        }
Ejemplo n.º 5
0
        private TeamMatchEntry CreateMatchEntry(HomeAway homeAway, int amountOfPlayers)
        {
            var me = new TeamMatchEntry
            {
                HomeAway = homeAway
            };

            me.CreateLineup(amountOfPlayers);
            return(me);
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PitcherDTO"/> class
 /// </summary>
 /// <param name="record">A <see cref="pitcher"/> containing information about a pitcher</param>
 internal PitcherDTO(pitcher record)
     : base(record.id, record.name)
 {
     Guard.Argument(record, nameof(record)).NotNull();
     Hand = record.hand.Equals("l", StringComparison.InvariantCultureIgnoreCase)
         ? PlayerHand.Left
         : PlayerHand.Right;
     Competitor = record.competitor.Equals("home", StringComparison.InvariantCultureIgnoreCase)
         ? HomeAway.Home
         : HomeAway.Away;
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PitcherDTO"/> class
 /// </summary>
 /// <param name="record">A <see cref="pitcher"/> containing information about a pitcher</param>
 internal PitcherDTO(pitcher record)
     : base(record.id, record.name)
 {
     Contract.Requires(record != null);
     Hand = record.hand.Equals("l", StringComparison.InvariantCultureIgnoreCase)
         ? PlayerHand.Left
         : PlayerHand.Right;
     Competitor = record.competitor.Equals("home", StringComparison.InvariantCultureIgnoreCase)
         ? HomeAway.Home
         : HomeAway.Away;
 }