Ejemplo n.º 1
0
        /// <inheritdoc />
        public MapBonus Convert(MapBonusDTO value, object state)
        {
            var entity = new UnknownMapBonus();

            this.Merge(entity, value, state);
            return(entity);
        }
Ejemplo n.º 2
0
        /// <summary>Converts the given object of type <see cref="MapBonusDataContract"/> to an object of type <see cref="MapBonus"/>.</summary>
        /// <param name="value">The value to convert.</param>
        /// <param name="state"></param>
        /// <returns>The converted value.</returns>
        public MapBonus Convert(MapBonusDataContract value, object state)
        {
            if (value == null)
            {
                throw new ArgumentNullException("value", "Precondition: value != null");
            }

            MapBonus mapBonus;

            if (string.Equals(value.Type, "bloodlust", StringComparison.OrdinalIgnoreCase))
            {
                mapBonus = new Bloodlust();
            }
            else
            {
                mapBonus = new UnknownMapBonus();
            }

            var owner = value.Owner;

            if (owner != null)
            {
                mapBonus.Owner = this.converterForTeamColor.Convert(owner, state);
            }

            return(mapBonus);
        }
Ejemplo n.º 3
0
 // Implement this method in a buddy class to set properties that are specific to 'UnknownMapBonus' (if any)
 partial void Merge(UnknownMapBonus entity, MapBonusDTO dto, object state);