Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
 public Currency(JSONProxy.Item item)
     : base(item)
 {
     this.Type = ProxyMapper.GetOrbType(item);
     this.ChaosValue = CurrencyHandler.GetChaosValue(this.Type);
     this.StackInfo = ProxyMapper.GetStackInfo(item.Properties);
 }
Exemplo n.º 3
0
 public Character(JSONProxy.Character character)
 {
     this.Name = character.Name;
     this.League = character.League;
     this.Class = character.Class;
     this.Level = character.Level;
 }
Exemplo n.º 4
0
        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);
            }
        }
Exemplo n.º 5
0
        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);
            }
        }
Exemplo n.º 6
0
 internal Prophecy(JSONProxy.Item item)
     : base(item)
 {
     this.ProphecyText = item.ProphecyText;
     this.FlavourText = item.FlavourText;
     this.ProphecyDifficultyText = item.ProphecyDifficultyText;
 }
Exemplo n.º 7
0
 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);
 }
Exemplo n.º 8
0
        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();
        }
Exemplo n.º 9
0
        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();
        }
Exemplo n.º 10
0
 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;
 }
Exemplo n.º 11
0
        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();
        }
Exemplo n.º 12
0
        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();
        }
Exemplo n.º 13
0
        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;
        }
Exemplo n.º 14
0
 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);
 }
Exemplo n.º 15
0
        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;
        }
Exemplo n.º 16
0
        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);
            }
        }
Exemplo n.º 17
0
 internal static OrbType GetOrbType(JSONProxy.Item item)
 {
     return GetOrbType(item.TypeLine);
 }
Exemplo n.º 18
0
        public Decoration(JSONProxy.Item item)
            : base(item)
        {

        }
Exemplo n.º 19
0
        protected Rarity getRarity(JSONProxy.Item item)
        {
            if (item.frameType <= 3)
                return (Rarity)item.frameType;

            return Rarity.Normal;
        }
Exemplo n.º 20
0
 internal Requirement(JSONProxy.Requirement proxy)
 {
     this.Name = proxy.Name;
     this.NameFirst = proxy.DisplayMode == 0;
     this.Value = ((object[])proxy.Value[0])[0].ToString();
 }
Exemplo n.º 21
0
 internal Socket(JSONProxy.Socket s)
 {
     this.Attribute = s.Attribute;
     this.Group = s.Group;
 }