示例#1
0
            public static void ConstructTable(string origin, string name, Dictionary <string, int> subs, ref int termCount, ref RantDictionaryTable table)
            {
                if (table != null)
                {
                    return;
                }
                if (name == null)
                {
                    throw new RantTableLoadException(origin, 1, 1, "err-table-missing-name");
                }

                if (termCount == 0 || subs.Count == 0)
                {
                    subs.Add("default", 0);
                    termCount = 1;
                }

                table = new RantDictionaryTable(name, termCount);

                foreach (var sub in subs)
                {
                    table.AddSubtype(sub.Key, sub.Value);
                }
            }