示例#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;
        }
示例#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);
 }
示例#3
0
 public Character(JSONProxy.Character character)
 {
     this.Name = character.Name;
     this.League = character.League;
     this.Class = character.Class;
     this.Level = character.Level;
 }
示例#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);
            }
        }
示例#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);
            }
        }
示例#6
0
 internal Prophecy(JSONProxy.Item item)
     : base(item)
 {
     this.ProphecyText = item.ProphecyText;
     this.FlavourText = item.FlavourText;
     this.ProphecyDifficultyText = item.ProphecyDifficultyText;
 }
示例#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);
 }
示例#8
0
文件: Map.cs 项目: kakesu/Procurement
        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();
        }
示例#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();
        }
示例#10
0
文件: Tab.cs 项目: kakesu/Procurement
 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;
 }
示例#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();
        }
示例#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();
        }
示例#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;
        }
示例#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);
 }
示例#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;
        }
示例#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);
            }
        }
示例#17
0
 internal static OrbType GetOrbType(JSONProxy.Item item)
 {
     return GetOrbType(item.TypeLine);
 }
示例#18
0
        public Decoration(JSONProxy.Item item)
            : base(item)
        {

        }
示例#19
0
        protected Rarity getRarity(JSONProxy.Item item)
        {
            if (item.frameType <= 3)
                return (Rarity)item.frameType;

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