private static Gear ParseGear(HtmlNode gearNode, ProfileParseConfig config)
		{
			var gear = new Gear();
			var gearArray = new[] { gearNode };

			var gearImage = config.GearImageGetter(gearArray).Single();
			var gearImageUris = ParseImage(gearImage, config);
			gear.ImageUri = gearImageUris.Item1;
			gear.RetinaImageUri = gearImageUris.Item2;

			var gearPowerMainSvg = config.GearPowerMainSvgGetter(gearArray).Single();
			gear.GearPowerMainSvgUri = ParseImageUriFromStyle(gearPowerMainSvg, config);

			var gearPowerSub = config.GearPowerSubGetter(gearArray).Single();
			var gearPowerSubArray = new[] { gearPowerSub };

			var gearPowerSub1Svg = config.GearPowerSub1Getter(gearPowerSubArray).Single();
			gear.GearPowerSub1SvgUri = ParseImageUriFromStyle(gearPowerSub1Svg, config);

			try
			{
				var gearPowerSub2Svg = config.GearPowerSub2Getter(gearPowerSubArray).Single();
				gear.GearPowerSub2SvgUri = ParseImageUriFromStyle(gearPowerSub2Svg, config);

				var gearPowerSub3Svg = config.GearPowerSub3Getter(gearPowerSubArray).Single();
				gear.GearPowerSub3SvgUri = ParseImageUriFromStyle(gearPowerSub3Svg, config);
			}
			catch (ArgumentOutOfRangeException) { }

			return gear;
		}
示例#2
0
 internal UserProfile(string name, Uri miiImageUri, byte rank, Udemae udemae, Uri weaponImageUri, Uri weaponRetinaImageUri, Gear headGear, Gear clothesGear, Gear shoesGear, List<PaintedRank> paintedRank)
 {
     this.Name = name;
     this.MiiImageUri = miiImageUri;
     this.Rank = rank;
     this.Udemae = udemae;
     this.WeaponImageUri = weaponImageUri;
     this.WeaponRetinaImageUri = weaponRetinaImageUri;
     this.HeadGear = headGear;
     this.ClothesGear = clothesGear;
     this.ShoesGear = shoesGear;
     this._PaintedRank = paintedRank;
 }