Exemple #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ReportComponentBase"/> class with default settings.
 /// </summary>
 public ReportComponentBase()
 {
     border             = new Border();
     fill               = new SolidFill();
     hyperlink          = new Hyperlink(this);
     bookmark           = "";
     exportable         = true;
     flagUseFill        = true;
     flagUseBorder      = true;
     flagPreviewVisible = true;
     flagSerializeStyle = true;
     shiftMode          = ShiftMode.Always;
     style              = "";
     evenStyle          = "";
     hoverStyle         = "";
     printOn            = PrintOn.FirstPage | PrintOn.LastPage | PrintOn.OddPages | PrintOn.EvenPages | PrintOn.RepeatedBand | PrintOn.SinglePage;
     beforePrintEvent   = "";
     afterPrintEvent    = "";
     afterDataEvent     = "";
     clickEvent         = "";
     cursor             = Cursors.Default;
     mouseMoveEvent     = "";
     mouseUpEvent       = "";
     mouseDownEvent     = "";
     mouseEnterEvent    = "";
     mouseLeaveEvent    = "";
     backlight          = false;
     SetFlags(Flags.CanGroup, true);
     if (BaseName.EndsWith("Object"))
     {
         BaseName = ClassName.Substring(0, ClassName.Length - 6);
     }
 }
Exemple #2
0
 private void setDataFromRawData()
 {
     callId = CallId.fromRaw(rawData);
     cType  = CType.fromRaw(rawData);
     callReceiveTone.fromRaw(rawData);
     name = Name.fromRaw(rawData);
 }
        private async Task GetDexEosContractsCostAsync(TokenCostServiceSettings settings, decimal eosToUsd, List <TokenCost> tokenCosts, CancellationToken token)
        {
            var client  = new HttpClient();
            var message = await client.GetAsync($"{settings.DexEosApi}/token", token)
                          .ConfigureAwait(false);

            message.EnsureSuccessStatusCode();

            var json = await message.Content.ReadAsStringAsync()
                       .ConfigureAwait(false);

            var typedResult = JsonConvert.DeserializeObject <DexEosToken.RootObject[]>(json);

            foreach (var item in typedResult)
            {
                var tokenCost = new TokenCost
                {
                    Contract  = BaseName.StringToName(item.code),
                    TokenName = item.symbol.ToUpper(),
                    EosRate   = item.summary.last_price,
                    UsdRate   = item.summary.last_price * eosToUsd
                };

                if (tokenCosts.Any(t => t.Contract == tokenCost.Contract && t.TokenName.Equals(tokenCost.TokenName)))
                {
                    continue;
                }

                tokenCosts.Add(tokenCost);
            }
        }
Exemple #4
0
 private void button2_Click(object sender, EventArgs e)
 {
     comboBox1.SelectedIndex = 0;
     BaseName.Clear();
     LoginTXT.Clear();
     HasłoTXT.Clear();
 }
Exemple #5
0
        private async Task InsertOrUpdateDappInfoAsync(NpgsqlConnection connection, RootObject root, CancellationToken token)
        {
            var info = root.Data.Info;
            var dApp = new Dapp
            {
                Id          = info.Id,
                Author      = info.Author,
                Slug        = info.Slug,
                Description = info.Description,
                Title       = info.Title,
                Url         = info.Url,
                Category    = info.Category
            };

            var contracts = new ulong[root.Data.Contracts.Count];

            for (var i = 0; i < root.Data.Contracts.Count; i++)
            {
                var contract = root.Data.Contracts[i];
                var aId      = BaseName.StringToName(contract.Address);
                var a        = BaseName.UlongToString(aId);
                if (a.Equals(contract.Address, StringComparison.Ordinal))
                {
                    contracts[i] = aId;
                }
                else
                {
                    return;
                }
            }

            await connection.InsertOrUpdateAsync(dApp, contracts, token);
        }
Exemple #6
0
        public void StringToNameTest2(string strIn, string strOut)
        {
            var val  = BaseName.StringToName(strIn);
            var bstr = BaseName.UlongToString(val);

            Assert.IsFalse(strOut.Equals(bstr, StringComparison.Ordinal), $"{strIn} | {strOut} | {bstr}");
        }
Exemple #7
0
        public new string GetString(string name, CultureInfo culture)
        {
            if (BasicMode)
            {
                return(base.GetString(name, CultureInfo.InvariantCulture));
            }

            try {
                if (_customDirect != null && _custom == null)
                {
                    _customDirect.TryGetValue(BaseName.Split('.').Last(), out _custom);
                    if (_custom == null && _customSource == null)
                    {
                        _custom = new Dictionary <string, string>();
                    }
                }

                if (_customSource != null && _custom == null)
                {
                    var location = Path.Combine(_customSource, BaseName.Split('.').Last() + "." + CultureInfo.CurrentUICulture + ".resx");
                    _custom = LoadCustomResource(location) ?? new Dictionary <string, string>();
                }

                if (_custom != null && _custom.TryGetValue(name, out var result))
                {
                    return(result);
                }

                return(base.GetString(name, culture));
            } catch (Exception e) {
                Logging.Warning(e);
                BasicMode = true;
                return(base.GetString(name, culture));
            }
        }
Exemple #8
0
 private void setDataFromRawData()
 {
     name = Name.fromRaw(rawData);
     for (int i = 0; i < ContactId.MAX_ID; i++)
     {
         contactIDs[i] = ContactId.fromRaw(rawData, i);
     }
 }
        public static Dictionary Load()
        {
            Dictionary result;

            try { result = BaseName.LoadAndDeserialize <Dictionary>(); }
            catch { return(new Dictionary()); }
            return(result);
        }
Exemple #10
0
 private void setDataFromRawData()
 {
     name = Name.fromRaw(rawData);
     for (int i = 0; i < ChannelId.MAX_ID; i++)
     {
         channelIDs[i] = ChannelId.fromRaw(rawData, i);
     }
 }
Exemple #11
0
        private string GetString(string name)
        {
            var culture = this.Culture ?? CultureInfo.CurrentUICulture;

            StringLocalization value = null;

            try
            {
                do
                {
                    var query = DbContext.StringLocalizations
                                .Where(l => l.Culture == culture.Name)
                                .Where(l => BaseName.Contains(l.Location))
                                .OrderByDescending(l => l.Location.Length);

                    value = query.FirstOrDefault(l => l.Key == name);

                    culture = culture.Parent;
                } while (value == null && !string.IsNullOrEmpty(culture.Name));
            }
            catch { }

            if (this.Environment.IsDevelopment())
            {
                try
                {
                    if (!DbContext.StringLocalizables.Any(l => l.Key == name && l.Location == BaseName))
                    {
                        DbContext.StringLocalizables.Add(new StringLocalizable
                        {
                            Location    = BaseName,
                            Key         = name,
                            Description = name
                        });
                        DbContext.SaveChanges();
                    }
                }
                catch (Exception ex)
                {
                    Logger.LogWarning(ex.ToString());
                }
            }

            if (value == null)
            {
                return(null);
            }
            else if (this.Environment.IsDevelopment())
            {
                return("[" + value.Value + "]");
            }
            else
            {
                return(value.Value);
            }
        }
Exemple #12
0
        /// <summary>
        ///   Compares this fomod info to the given fomod info.
        /// </summary>
        /// <param name="other">The fomod info to which to compare this fomod info.</param>
        /// <returns>
        ///   A value less than 0 if this fomod info is less than the given fomod info;
        ///   or, a value of 0 if this fomod info is equal to the given fomod info;
        ///   or, a value greater than 0 if this fomod is greater then the given fomod info.
        /// </returns>
        public int CompareTo(FomodInfo other)
        {
            var intResult = BaseName.CompareTo(other.BaseName);

            if (intResult == 0)
            {
                intResult = MachineVersion.CompareTo(other.MachineVersion);
            }
            return(intResult);
        }
Exemple #13
0
 /// <summary>
 /// Initializes a new instance of the <b>DialogComponentBase</b> class with default settings.
 /// </summary>
 public DialogComponentBase()
 {
     if (BaseName.EndsWith("Component"))
     {
         BaseName = ClassName.Remove(ClassName.IndexOf("Component"));
     }
     if (BaseName.EndsWith("Control"))
     {
         BaseName = ClassName.Remove(ClassName.IndexOf("Control"));
     }
 }
Exemple #14
0
        private async Task <RootObject> GetDappInfoOrDefaultAsync(HttpClient client, string url, CancellationToken token)
        {
            try
            {
                var msg = await client.GetAsync(url, token);

                if (!msg.IsSuccessStatusCode)
                {
                    return(null);
                }

                var json = await msg.Content.ReadAsStringAsync();

                var root = JsonConvert.DeserializeObject <RootObject>(json);

                if (root.app.contracts != null && root.app.contracts.Any())
                {
                    var contracts = new ulong[root.app.contracts.Length];
                    for (var i = 0; i < root.app.contracts.Length; i++)
                    {
                        var contract = root.app.contracts[i];
                        var name     = contract.Type == JTokenType.String
                            ? contract.Value <string>()
                            : contract.Value <string>("address");

                        if (string.IsNullOrEmpty(name))
                        {
                            return(null);
                        }

                        var aId = BaseName.StringToName(name);
                        var a   = BaseName.UlongToString(aId);
                        if (a.Equals(name, StringComparison.Ordinal))
                        {
                            contracts[i] = aId;
                        }
                        else
                        {
                            return(null);
                        }
                    }

                    return(root);
                }
            }
            catch (Exception e)
            {
                Logger.LogWarning(e, e.Message);
            }

            return(null);
        }
Exemple #15
0
        private void setDataFromRawData()
        {
            name                  = Name.fromRaw(rawData);
            priorityChannel1      = PriorityChannelId.fromRaw(rawData, PriorityChannelId.CHANNEL1);
            priorityChannel2      = PriorityChannelId.fromRaw(rawData, PriorityChannelId.CHANNEL2);
            txDesignatedChannelId = TXDesignatedChannelId.fromRaw(rawData);
            signalingHoldTime     = SignalingHoldTime.fromRaw(rawData);
            prioritySampleTime    = PrioritySampleTime.fromRaw(rawData);

            for (int i = 0; i < ChannelId.MAX_ID; i++)
            {
                channelIDs[i] = ChannelId.fromRaw(rawData, i);
            }
        }
Exemple #16
0
        public void CharToSymbolTest()
        {
            for (int i = 0; i < 255; i++)
            {
                var c = (char)i;
                if ((c >= 'a' && c <= 'z') || (c >= '1' || c <= '5'))
                {
                    continue;
                }

                var val = BaseName.CharToSymbol(c);
                Assert.IsTrue(val == (ulong)0, $"{val} != 0");
            }
        }
Exemple #17
0
        private Method GetComplement()
        {
            char complement;

            if (is_get)
            {
                complement = 'S';
            }
            else
            {
                complement = 'G';
            }

            return(container_type.GetMethod(complement + BaseName.Substring(1)));
        }
Exemple #18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BandBase"/> class with default settings.
 /// </summary>
 public BandBase()
 {
     objects           = new ReportComponentCollection(this);
     guides            = new FloatCollection();
     beforeLayoutEvent = "";
     afterLayoutEvent  = "";
     outlineExpression = "";
     CanBreak          = false;
     ShiftMode         = ShiftMode.Never;
     if (BaseName.EndsWith("Band"))
     {
         BaseName = ClassName.Remove(ClassName.IndexOf("Band"));
     }
     SetFlags(Flags.CanMove | Flags.CanChangeOrder | Flags.CanChangeParent | Flags.CanCopy | Flags.CanGroup, false);
     FlagUseStartNewPage = true;
     FlagCheckFreeSpace  = true;
 }
Exemple #19
0
 /// <summary>
 /// Metoda zawierająca inizjalizację wszystkich komend w widoku
 /// W tym widoku jest tylko jedna komenda opisana wyżej
 /// </summary>
 private void InitCommand()
 {
     CreateBaseCommand = new RelayCommand(() =>
     {
         if (PathName == null)
         {
             MessageBoxResult result = MessageBox.Show("Wybierz odpowiednie rozszerzenie",
                                                       "Confirmation", MessageBoxButton.OK);
         }
         else if (BaseName == null || BaseName == "")
         {
             MessageBoxResult result = MessageBox.Show("Podaj nazwę bazy",
                                                       "Confirmation", MessageBoxButton.OK);
         }
         else if (TableName == null || TableName == "")
         {
             MessageBoxResult result = MessageBox.Show("Podaj nazwę arkusza",
                                                       "Confirmation", MessageBoxButton.OK);
         }
         else if (BaseName.FirstOrDefault() >= '0' && BaseName.FirstOrDefault() <= '9')
         {
             MessageBoxResult result = MessageBox.Show("Nazwa nie powinna zaczynać się cyfrą\n" +
                                                       "lub być liczbą",
                                                       "Confirmation", MessageBoxButton.OK);
             BaseName = "";
         }
         else if (TableName.FirstOrDefault() >= '0' && TableName.FirstOrDefault() <= '9')
         {
             MessageBoxResult result = MessageBox.Show("Nazwa nie powinna zaczynać się cyfrą\n" +
                                                       "lub być liczbą",
                                                       "Confirmation", MessageBoxButton.OK);
             TableName = "";
         }
         else
         {
             string file = $"D:\\{BaseName}.{PathName}";
             var stream  = new FileStream(file, FileMode.Create, FileAccess.Write);
             //XSSFWorkbook workbook = new XSSFWorkbook();
             XSSFSheet sheet = (XSSFSheet)(App.workbook.CreateSheet($"{TableName}"));
             App.workbook.Write(stream);
             stream.Close();
             navigationService.NavigateTo(ViewModelLocator.CreateBaseAddColumnsKey, file);
         }
     });
 }
Exemple #20
0
        private async Task InsertOrUpdateDappInfoAsync(NpgsqlConnection connection, RootObject root, CancellationToken token)
        {
            const int minId = 1000000;
            const int maxId = 3000000;

            var dapp = new Dapp
            {
                Author      = root.app.developer ?? string.Empty,
                Slug        = root.app.identifier,
                Description = root.app.desc_en ?? string.Empty,
                Title       = root.app.@abstract ?? string.Empty,
                Url         = root.app.url ?? string.Empty,
                Category    = root.app.category?.name ?? string.Empty
            };

            var contracts = new ulong[root.app.contracts.Length];

            for (var i = 0; i < root.app.contracts.Length; i++)
            {
                var contract = root.app.contracts[i];
                var name     = contract.Type == JTokenType.String
                    ? contract.Value <string>()
                    : contract.Value <string>("address");

                var aId = BaseName.StringToName(name);
                var a   = BaseName.UlongToString(aId);
                if (a.Equals(name, StringComparison.Ordinal))
                {
                    contracts[i] = aId;
                }
                else
                {
                    return;
                }
            }

            await connection.FindAndInsertOrUpdateAsync(minId, maxId, dapp, contracts, token);
        }
        private async Task GetNewDexContractsCostAsync(TokenCostServiceSettings settings, decimal eosToUsd, List <TokenCost> tokenCosts, CancellationToken token)
        {
            var client  = new HttpClient();
            var message = await client.GetAsync($"{settings.NewDexApi}/tickers", token)
                          .ConfigureAwait(false);

            message.EnsureSuccessStatusCode();

            var json = await message.Content.ReadAsStringAsync()
                       .ConfigureAwait(false);

            var typedResult = JsonConvert.DeserializeObject <NewDexToken.RootObject>(json);

            foreach (var item in typedResult.data)
            {
                if (!item.symbol.EndsWith("-eos"))
                {
                    continue;
                }

                var tokenCost = new TokenCost
                {
                    Contract  = BaseName.StringToName(item.contract),
                    TokenName = item.currency.ToUpper(),
                    EosRate   = item.last,
                    UsdRate   = item.last * eosToUsd
                };

                if (tokenCosts.Any(t => t.Contract == tokenCost.Contract && t.TokenName.Equals(tokenCost.TokenName)))
                {
                    continue;
                }

                tokenCosts.Add(tokenCost);
            }
        }
        public ParsedSkill(string internalname, string skillid, string stype, string category)
        {
            SkillId = skillid;
            sType   = stype;
            var i = category.IndexOf(',');

            Category = i == -1 ? category : category.Split(',').FirstOrDefault(x => x.Length >= 5) ?? category;
            string cut = internalname.ToLowerInvariant().Replace("_", " ");

            modifiers = new List <string> {
            };
            bool _cut = true;

            while (_cut)
            {
                _cut = false;
                foreach (string mod in allmods)
                {
                    if ((mod == " blast") && cut.Contains("priest"))
                    {
                        continue;                                             // fix holy shot=holy blast
                    }
                    if ((mod == " normal") && cut.Contains("archer"))
                    {
                        continue;                                              // fix normal shot
                    }
                    if ((mod == " combo") && !cut.Contains("assassin"))
                    {
                        continue;                                                // combo postfix - only for ninja
                    }
                    if ((mod == " jin") && cut.Contains("sorcerer"))
                    {
                        if (cut.Remove(mod, out cut))
                        {
                            modifiers.Add(mod);
                            _cut = true;
                            break;
                        }
                    }
                    if (cut.RemoveFromEnd(mod, out cut))
                    {
                        modifiers.Add(mod);
                        _cut = true;
                        break;
                    }
                }
            }
            foreach (var lvl in levels)
            {
                if (cut.Contains(lvl.Key))
                {
                    cut = cut.Replace(lvl.Key, "");
                    Lvl = lvl.Value;
                    break;
                }
            }

            BaseName = cut;
            if (BaseName.Contains("assault") && BaseName.Contains("berserk"))
            {
                BaseName = BaseName + category;
            }                                                                                            //fix berserk

            if (modifiers.Contains(" continuous") || modifiers.Contains(" large") || modifiers.Contains(" chain") || modifiers.Contains(" short") || modifiers.Contains(" shortairreaction"))
            {
                Chained = "True";
            }
            else
            {
                Chained = "False";
            }

            if (modifiers.Contains(" explosion") || modifiers.Contains(" explosionforbot") || modifiers.Contains(" realtargeting"))
            {
                Detail = "Boom";
            }

            if (modifiers.Contains("01") && ((sType.Contains("combo") || modifiers.Contains(" shortairreaction"))) && (!BaseName.Contains("thunder drake")))
            {
                Detail = "hit 1";
            }

            if ((modifiers.Contains("02") || modifiers.Contains("03") || modifiers.Contains("04") || modifiers.Contains("05") || modifiers.Contains("06") || modifiers.Contains("07") ||
                 modifiers.Contains("08") || modifiers.Contains("09")) && (!(modifiers.Contains(" projectile") || modifiers.Contains(" shot")) || (modifiers.Contains(" shortairreaction"))))

            {
                Detail = Detail + "hit " + modifiers.Find(x => x.Contains("0")).Substring(1, 1);
            }

            if ((modifiers.Contains("00") || modifiers.Contains("01") || modifiers.Contains("02") || modifiers.Contains("03") || modifiers.Contains("04") || modifiers.Contains("05") || modifiers.Contains("06") || modifiers.Contains("07") ||
                 modifiers.Contains("08") || modifiers.Contains("09")) && (modifiers.Contains(" shot")) && (!modifiers.Contains(" projectile")) && (!modifiers.Contains(" cast")) && (!sType.Contains("capture")) && (!BaseName.Contains("thunder drake")))

            {
                Detail = Detail + "hit " + (int.Parse(modifiers.Find(x => x.Contains("0")).Substring(1, 1)) + 1).ToString();
            }

            if ((modifiers.Contains("00") || modifiers.Contains("01") || modifiers.Contains("02") || modifiers.Contains("03") || modifiers.Contains("04") || modifiers.Contains("05") || modifiers.Contains("06") || modifiers.Contains("07") ||
                 modifiers.Contains("08") || modifiers.Contains("09")) && (modifiers.Contains(" projectile")) && (!modifiers.Contains(" shot")))
            {
                if (BaseName.Contains("sorcerer"))
                {
                    if (!(skillid.EndsWith("0") && modifiers.Contains("01")))
                    {
                        Detail = "hit " + (int.Parse(modifiers.Find(x => x.Contains("0")).Substring(1, 1)) + 1).ToString();
                    }
                }
                if (BaseName.Contains("priest"))
                {
                    if (!(modifiers.Contains("00") || modifiers.Contains("01")))
                    {
                        Detail = "hit " + modifiers.Find(x => x.Contains("0")).Substring(1, 1);
                    }
                }
            }
            if ((modifiers.Contains("00") || modifiers.Contains("01") || modifiers.Contains("02") || modifiers.Contains("03") || modifiers.Contains("04")) &&
                (((modifiers.Contains(" projectile")) && (modifiers.Contains(" shot"))) || ((modifiers.Contains(" cast")) && (modifiers.Contains(" shot")))) && (BaseName.Contains("priest")))
            {
                Detail = "hit " + modifiers.Find(x => x.Contains("0")).Substring(1, 1);
            }                                                                              //holy shot

            if (((modifiers.Contains("00") || modifiers.Contains("01") || modifiers.Contains("02") || modifiers.Contains("03") || modifiers.Contains("04")) &&
                 modifiers.Contains(" shot")) && (BaseName.Contains("elementalist")) && (sType == "combo" || sType == "combo_instance"))
            {
                Detail = "hit " + modifiers.Find(x => x.Contains("0")).Substring(1, 1);
            }                                                                              //Magic Arrow

            if (modifiers.Contains(" on"))
            {
                Detail = "On";
            }

            if (modifiers.Contains(" off"))
            {
                Detail = "Off";
            }

            if (modifiers.Contains(" superarmor"))
            {
                Detail = "SA";
            }

            if (modifiers.Contains(" fury"))
            {
                Detail = "Fury";
            }

            if (modifiers.Contains(" fail"))
            {
                Detail = "Dash fail";
            }

            if (modifiers.Contains(" blast") && (!BaseName.Contains("priest")))
            {
                Detail = "Blast";
            }

            if (modifiers.Contains(" flying"))
            {
                Detail = "forward";
            }

            if (modifiers.Contains(" return"))
            {
                Detail = "backward";
            }

            if (modifiers.Contains(" stopping"))
            {
                Detail = "stopping";
            }

            if (modifiers.Contains(" jin"))
            {
                Detail = "MB";
            }

            if (modifiers.Contains(" for distortion"))
            {
                Detail = Detail + " FD";
            }

            if (modifiers.Contains(" side"))
            {
                Detail = "Side " + Detail;
            }
        }
Exemple #23
0
 // Use the hash code of the string objects and xor them together.
 public override int GetHashCode()
 {
     return((BaseName.GetHashCode() ^ KeyPrefix.GetHashCode()) ^ AssemblyFullName.GetHashCode());
 }
 /// <summary>
 /// 是内置资源基础名称。
 /// </summary>
 /// <returns>返回布尔值。</returns>
 protected virtual bool IsInternalResourceBaseName()
 => InternalResourceBaseName.Equals(BaseName.Split('.').Last(), StringComparison.OrdinalIgnoreCase);
 // Use the hash code of the string objects and xor them together.
 public override int GetHashCode()
 {
     // ReSharper disable NonReadonlyMemberInGetHashCode
     return((BaseName.GetHashCode() ^ KeyPrefix.GetHashCode()) ^ AssemblyFullName.GetHashCode());
     // ReSharper restore NonReadonlyMemberInGetHashCode
 }
Exemple #26
0
 /// <summary>
 /// Hash on all name components.
 /// </summary>
 public override int GetHashCode()
 {
     return(XmlNamespace.GetHashCode() ^ BaseName.GetHashCode());
 }
Exemple #27
0
        public ItemData(NormalInventoryItem inventoryItem, BaseItemType baseItemType)
        {
            InventoryItem = inventoryItem;
            InventoryID   = inventoryItem.Item.InventoryId;
            var item = inventoryItem.Item;

            Path = item.Path;
            var baseComponent = item.GetComponent <Base>();

            if (baseComponent == null)
            {
                return;
            }
            isElder      = baseComponent.isElder;
            isShaper     = baseComponent.isShaper;
            isCorrupted  = baseComponent.isCorrupted;
            isCrusader   = baseComponent.isCrusader;
            isRedeemer   = baseComponent.isRedeemer;
            isWarlord    = baseComponent.isWarlord;
            isHunter     = baseComponent.isHunter;
            isInfluenced = isCrusader || isRedeemer || isWarlord || isHunter || isShaper || isElder;

            var mods = item.GetComponent <Mods>();

            Rarity        = mods?.ItemRarity ?? ItemRarity.Normal;
            BIdentified   = mods?.Identified ?? true;
            ItemLevel     = mods?.ItemLevel ?? 0;
            Veiled        = mods?.ItemMods.Where(m => m.DisplayName.Contains("Veil")).Count() ?? 0;
            Fractured     = mods?.CountFractured ?? 0;
            SkillGemLevel = item.GetComponent <SkillGem>()?.Level ?? 0;
            //SkillGemQualityType = (int)item.GetComponent<SkillGem>()?.QualityType;
            Synthesised        = mods?.Synthesised ?? false;
            isBlightMap        = mods?.ItemMods.Where(m => m.Name.Contains("InfectedMap")).Count() > 0;
            isElderGuardianMap = mods?.ItemMods.Where(m => m.Name.Contains("MapElderContainsBoss")).Count() > 0;
            Enchanted          = mods?.ItemMods.Where(m => m.Name.Contains("Enchantment")).Count() > 0;
            DeliriumStacks     = mods?.ItemMods.Where(m => m.Name.Contains("AfflictionMapReward")).Count() ?? 0;


            NumberOfSockets = item.GetComponent <Sockets>()?.NumberOfSockets ?? 0;
            LargestLinkSize = item.GetComponent <Sockets>()?.LargestLinkSize ?? 0;

            ItemQuality = item.GetComponent <Quality>()?.ItemQuality ?? 0;
            ClassName   = baseItemType.ClassName;
            BaseName    = baseItemType.BaseName;

            Name        = baseComponent?.Name ?? "";
            Description = "";
            MapTier     = item.GetComponent <Map>()?.Tier ?? 0;
            clientRect  = InventoryItem.GetClientRect().Center;

            if (Name == "Prophecy")
            {
                BaseName = "Prophecy";
                var prophecyComponent = item.HasComponent <Prophecy>()? item.GetComponent <Prophecy>() : null;
                if (prophecyComponent == null)
                {
                    return;
                }
                Name        = prophecyComponent.DatProphecy?.Name?.ToLower() ?? "";
                Name        = Regex.Replace(Name, @"[ ,']", "");
                Description = prophecyComponent.DatProphecy?.PredictionText?.ToLower() ?? "";
                Description = Regex.Replace(Description, @"[ ,']", "");
            }
            else
            {
                Name = mods?.UniqueName ?? "";
            }

            if (BaseName.StartsWith("Metamorph"))
            {
                var stats = mods?.HumanStats;
                if (stats != null)
                {
                    MetamorphSampleRewardsAmount = stats.Count();

                    //var _stats = stats.Select(str => str.ToLower()).ToList();
                    //_stats = _stats.Select(str => str.Replace(" ", "")).ToList();
                    //_stats = _stats.Select(x => x.Substring(5)).ToList();

                    //MetamorphSampleGoodRewardsAmount = stats.Count(x => goodRewardsHS.Contains(x));

                    //MetamorphSampleGoodRewardsAmount = _stats.Where(stat => goodRewards.Any(rewards => rewards.Equals(stat))).Count();
                    //MetamorphSampleBadRewardsAmount = _stats.Where(stat => badRewards.Any(rewards => rewards.Equals(stat))).Count();
                }
                else
                {
                    MetamorphSampleRewardsAmount = -1;
                }
            }
        }
 public int CompareTo(object other)
 {
     return(BaseName.CompareTo(other.ToString()));
 }
Exemple #29
0
        private Method GetComplement()
        {
            var complement = IsGetter ? 'S' : 'G';

            return(ContainerType.GetMethod($"{complement}{BaseName.Substring(1)}"));
        }
Exemple #30
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (BaseName.Length != 0)
            {
                hash ^= BaseName.GetHashCode();
            }
            if (BaseTime != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(BaseTime);
            }
            if (BaseUnit.Length != 0)
            {
                hash ^= BaseUnit.GetHashCode();
            }
            if (BaseVersion != 0)
            {
                hash ^= BaseVersion.GetHashCode();
            }
            if (baseValueOptionalCase_ == BaseValueOptionalOneofCase.BaseValue)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(BaseValue);
            }
            if (baseSumOptionalCase_ == BaseSumOptionalOneofCase.BaseSum)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(BaseSum);
            }
            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (Unit.Length != 0)
            {
                hash ^= Unit.GetHashCode();
            }
            if (Time != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Time);
            }
            if (UpdateTime != 0D)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(UpdateTime);
            }
            if (valueOneofCase_ == ValueOneofOneofCase.Value)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Value);
            }
            if (valueOneofCase_ == ValueOneofOneofCase.StringValue)
            {
                hash ^= StringValue.GetHashCode();
            }
            if (valueOneofCase_ == ValueOneofOneofCase.DataValue)
            {
                hash ^= DataValue.GetHashCode();
            }
            if (valueOneofCase_ == ValueOneofOneofCase.BoolValue)
            {
                hash ^= BoolValue.GetHashCode();
            }
            if (sumOptionalCase_ == SumOptionalOneofCase.Sum)
            {
                hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Sum);
            }
            hash ^= (int)baseValueOptionalCase_;
            hash ^= (int)baseSumOptionalCase_;
            hash ^= (int)valueOneofCase_;
            hash ^= (int)sumOptionalCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }