コード例 #1
0
ファイル: SkinConverter.cs プロジェクト: tigerbytes/GW2.NET
        partial void Merge(Skin entity, SkinDTO dto, object state)
        {
            if (state == null)
            {
                throw new ArgumentNullException("state", "Precondition: state is IResponse");
            }

            var response = state as IResponse;
            if (response == null)
            {
                throw new ArgumentException("Precondition: state is IResponse", "state");
            }

            entity.Culture = response.Culture;
            entity.SkinId = dto.Id;
            entity.Name = dto.Name;

            if (dto.Flags != null)
            {
                entity.Flags = this.skinFlagsConverter.Convert(dto.Flags, state);
            }

            if (dto.Restrictions != null)
            {
                entity.Restrictions = this.itemRestrictionsConverter.Convert(dto.Restrictions, state);
            }

            // Process the URI. Note since the V2 api the URI doesn't have to be built by hand anymore.
            // It is stored as a a string in the response.
            // Question: Shouled we split the URI for user convenience or not??
            // TODO: yes we should split the URI. Not for convencience, but because 'Skin' implements 'IRenderable'
            entity.IconFileUrl = new Uri(dto.IconUrl, UriKind.Absolute);
        }
コード例 #2
0
        partial void Merge(WeaponSkin entity, SkinDTO dto, object state)
        {
            var details = dto.Details;
            if (details == null)
            {
                return;
            }

            if (details.DamageClass != null)
            {
                entity.DamageType = this.damageClassConverter.Convert(details.DamageClass, details);
            }
        }
コード例 #3
0
        partial void Merge(ArmorSkin entity, SkinDTO dto, object state)
        {
            var details = dto.Details;
            if (details == null)
            {
                return;
            }

            if (details.WeightClass != null)
            {
                entity.WeightClass = this.weightClassConverter.Convert(details.WeightClass, details);
            }
        }