SpringModEdit.Mod.GetAllBuildOptions C# (CSharp) Méthode

GetAllBuildOptions() public méthode

public GetAllBuildOptions ( ) : List>.Dictionary
Résultat List>.Dictionary
        public Dictionary<string, List<string>> GetAllBuildOptions()
        {
            var opts = new Dictionary<string, List<string>>();
            foreach (DictionaryEntry de in Units) {
                var t = de.Value as LuaTable;
                var res = new List<string>();
                if (t == null) opts.Add(de.Key.ToString(), res);
                else {
                    var builds = t["buildoptions"] as LuaTable;
                    if (builds != null) foreach (var s in builds.Values) if (s is string) res.Add((string) s);
                    opts.Add(de.Key.ToString(), res);
                }
            }
            return opts;
        }

Usage Example

Exemple #1
0
 public void ReloadBuildTree()
 {
     builds      = mod.GetAllBuildOptions();
     lbUnit.Text = selectedUnit + " - " + mod.GetUnitDescription(selectedUnit);
     FillOptions();
 }