StonehearthEditor.NetWorthVisualizer.UpdateNetWorthData C# (CSharp) Method

UpdateNetWorthData() public method

public UpdateNetWorthData ( ) : void
return void
        public void UpdateNetWorthData()
        {
            mItemCount = 0;
            mMaxNetWorth = 0;
            mNetWorthValues = new Dictionary<int, List<JsonFileData>>();
            foreach (Module mod in ModuleDataManager.GetInstance().GetAllModules())
            {
                foreach (ModuleFile file in mod.GetAliases())
                {
                    JsonFileData data = file.FileData as JsonFileData;
                    if (data == null)
                    {
                        continue;
                    }

                    int netWorth = data.NetWorth;
                    if (netWorth <= 0)
                    {
                        continue;
                    }

                    string imageFile = FindImageForFile(data);
                    if (string.IsNullOrEmpty(imageFile))
                    {
                        Console.WriteLine("file " + data.FileName + " has no icon!");
                        continue;
                    }

                    if (netWorth > mMaxNetWorth)
                    {
                        mMaxNetWorth = netWorth;
                    }

                    List<JsonFileData> list;
                    if (!mNetWorthValues.TryGetValue(netWorth, out list))
                    {
                        list = new List<JsonFileData>();
                        mNetWorthValues[netWorth] = list;
                    }

                    list.Add(data);
                    if (list.Count > mItemCount)
                    {
                        mItemCount = list.Count;
                    }
                }
            }

            canvas.Refresh();
        }

Usage Example

Exemplo n.º 1
0
 public void Reload()
 {
     manifestView.Reload();
     entityBrowserView.Reload();
     encounterDesignerView.Reload();
     if (mNetWorthVisualizer != null && !mNetWorthVisualizer.IsDisposed)
     {
         mNetWorthVisualizer.UpdateNetWorthData();
     }
 }
All Usage Examples Of StonehearthEditor.NetWorthVisualizer::UpdateNetWorthData