protected Item(JSONProxy.Item item) { this.Verified = item.Verified; this.Identified = item.Identified; this.W = item.W; this.H = item.H; this.IconURL = item.Icon; this.League = item.League; this.Name = item.Name; this.TypeLine = item.TypeLine; this.DescrText = item.DescrText; this.X = item.X; this.Y = item.Y; this.inventoryId = item.InventoryId; this.SecDescrText = item.SecDescrText; this.Explicitmods = item.ExplicitMods; this.ItemType = Model.ItemType.UnSet; if (item.Properties != null) { this.Properties = item.Properties.Select(p => new Property(p)).ToList(); if (this.Properties.Any(p => p.Name == "Quality")) { this.IsQuality = true; this.Quality = ProxyMapper.GetQuality(item.Properties); } } this.Corrupted = item.Corrupted; this.Microtransactions = item.CosmeticMods == null ? new List<string>() : item.CosmeticMods; }
public Currency(JSONProxy.Item item) : base(item) { this.Type = ProxyMapper.GetOrbType(item); this.ChaosValue = CurrencyHandler.GetChaosValue(this.Type); this.StackInfo = ProxyMapper.GetStackInfo(item.Properties); }
public Character(JSONProxy.Character character) { this.Name = character.Name; this.League = character.League; this.Class = character.Class; this.Level = character.Level; }
public static Item Get(JSONProxy.Item item) { try { if (item.frameType == 4) return new Gem(item); if (item.DescrText != null && item.DescrText.ToLower() == "right click this item then left click a location on the ground to create the object.") return new Decoration(item); if (item.frameType == 5) return new Currency(item); if (item.TypeLine.Contains("Map") && item.DescrText != null && item.DescrText.Contains("Travel to this Map")) return new Map(item); return new Gear(item); } catch (Exception ex) { Logger.Log(ex); var errorMessage = "ItemFactory unable to instanciate type : " + item.TypeLine; Logger.Log(errorMessage); throw new Exception(errorMessage); } }
public static Item Get(JSONProxy.Item item) { try { if (item.frameType == 4) return new Gem(item); if (item.DescrText != null && item.DescrText.ToLower() == Lang.DecorationItemDescStrValue.ToLower()) return new Decoration(item); if (item.frameType == 5) return new Currency(item); if (item.TypeLine.Contains(Lang.MapStrValue) && item.DescrText != null && item.DescrText.Contains(Lang.MapDescStrValue)) return new Map(item); return new Gear(item); } catch (Exception ex) { Logger.Log(ex); var errorMessage = "ItemFactory unable to instanciate type : " + item.TypeLine; Logger.Log(errorMessage); throw new Exception(errorMessage); } }
internal Prophecy(JSONProxy.Item item) : base(item) { this.ProphecyText = item.ProphecyText; this.FlavourText = item.FlavourText; this.ProphecyDifficultyText = item.ProphecyDifficultyText; }
internal Map(JSONProxy.Item item) : base(item) { this.ItemType = Model.ItemType.Gear; this.Properties = ProxyMapper.GetProperties(item.Properties); this.Rarity = getRarity(item); this.MapTier = int.Parse(Properties.Find(p => p.Name == "Map Tier").Values[0].Item1); }
internal Map(JSONProxy.Item item) : base(item) { this.ItemType = Model.ItemType.Gear; this.Properties = ProxyMapper.GetProperties(item.Properties); this.Rarity = getRarity(item); this.MapLevel = int.Parse(Properties.Find(p => p.Name == "Map Level").Values[0].Item1); this.UniqueIDHash = base.getHash(); }
public Currency(JSONProxy.Item item) : base(item) { this.Type = ProxyMapper.GetOrbType(item); this.GCPValue = CurrencyHandler.GetGCPValue(this.Type); this.StackInfo = ProxyMapper.GetStackInfo(item.Properties); this.UniqueIDHash = base.getHash(); }
public Tab(JSONProxy.Tab t) { this.Colour = new Colour() { b = t.colour.b, g = t.colour.g, r = t.colour.r }; i = t.i; Name = t.n; srcR = getUrl(t.srcR); srcC = getUrl(t.srcC); srcL = getUrl(t.srcL); Hidden = t.hidden; }
public Gem(JSONProxy.Item item) : base(item) { this.Properties = ProxyMapper.GetProperties(item.Properties); this.ItemType = Model.ItemType.Gem; this.Socket = item.Socket; this.Color = item.Color; this.Requirements = ProxyMapper.GetRequirements(item.Requirements); this.Level = getLevel(); }
public Gem(JSONProxy.Item item) : base(item) { this.Properties = ProxyMapper.GetProperties(item.Properties); this.ItemType = Model.ItemType.Gem; this.IsSupport = item.Support; this.Socket = item.Socket; this.Color = item.Color; this.Requirements = ProxyMapper.GetRequirements(item.Requirements); this.UniqueIDHash = base.getHash(); }
internal Property(JSONProxy.Property property) { this.Name = property.Name; Values = new List<Tuple<string, int>>(); foreach (object value in property.Values) { object[] pair = (object[])value; Values.Add(new Tuple<string, int>(pair[0].ToString(), int.Parse(pair[1].ToString()))); } this.DisplayMode = property.DisplayMode; }
internal Gear(JSONProxy.Item item) : base(item) { this.Rarity = getRarity(item); this.FlavourText = item.FlavourText; this.Sockets = item.Sockets.Select(proxy => new Socket(proxy)).ToList(); this.Explicitmods = item.ExplicitMods; this.SocketedItems = item.SocketedItems.Select(proxy => (Gem)ItemFactory.Get(proxy)).ToList(); this.Implicitmods = item.ImplicitMods; this.Requirements = ProxyMapper.GetRequirements(item.Requirements); this.ItemType = Model.ItemType.Gear; this.GearType = GearTypeFactory.GetType(this); this.BaseType = GearTypeFactory.GetBaseType(this); }
protected Item(JSONProxy.Item item) { this.Verified = item.Verified; this.Identified = item.Identified; this.W = item.W; this.H = item.H; this.IconURL = getIconUrl(item.Icon); this.League = item.League; this.Name = humanizeName(item.Name); this.TypeLine = humanizeName(item.TypeLine); this.DescrText = item.DescrText; this.X = item.X; this.Y = item.Y; this.InventoryId = item.InventoryId; this.SecDescrText = item.SecDescrText; this.Explicitmods = item.ExplicitMods; this.ItemType = Model.ItemType.UnSet; this.CraftedMods = item.CraftedMods; if (item.Properties != null) { this.Properties = item.Properties.Select(p => new Property(p)).ToList(); if (this.Properties.Any(p => p.Name == Lang.QualityStrValue)) { this.IsQuality = true; this.Quality = ProxyMapper.GetQuality(item.Properties); } } this.Corrupted = item.Corrupted; this.Microtransactions = item.CosmeticMods == null ? new List<string>() : item.CosmeticMods; this.TradeX = this.X; this.TradeY = this.Y; this.TradeInventoryId = this.InventoryId; this.Character = string.Empty; }
public static Item Get(JSONProxy.Item item) { try { if (item.frameType == 4) return new Gem(item); if (item.frameType == 5) return new Currency(item); if (item.TypeLine.Contains("Map") && item.DescrText != null && item.DescrText.Contains("Travel to this Map")) return new Map(item); return new Gear(item); } catch (Exception ex) { Logger.Log(ex); var errorMessage = "ItemFactory unable to instanciate type : " + item.TypeLine; Logger.Log(errorMessage); throw new Exception(errorMessage); } }
internal static OrbType GetOrbType(JSONProxy.Item item) { return GetOrbType(item.TypeLine); }
public Decoration(JSONProxy.Item item) : base(item) { }
protected Rarity getRarity(JSONProxy.Item item) { if (item.frameType <= 3) return (Rarity)item.frameType; return Rarity.Normal; }
internal Requirement(JSONProxy.Requirement proxy) { this.Name = proxy.Name; this.NameFirst = proxy.DisplayMode == 0; this.Value = ((object[])proxy.Value[0])[0].ToString(); }
internal Socket(JSONProxy.Socket s) { this.Attribute = s.Attribute; this.Group = s.Group; }