示例#1
0
 public AllegianceDictionary Merge(AllegianceDictionary other)
 {
     foreach (var pair in other)
     {
         TryAdd(pair.Key, pair.Value);
     }
     return(this);
 }
示例#2
0
            private static AllegianceDictionary Parse(StreamReader reader)
            {
                Func <string, string> nullIfEmpty = (s) => string.IsNullOrWhiteSpace(s) ? null : s;
                var dict   = new AllegianceDictionary();
                var parser = new Serialization.TSVParser(reader);

                foreach (var row in parser.Data)
                {
                    dict.Add(
                        row.dict["Code"], row.dict["Legacy"], nullIfEmpty(row.dict["BaseCode"]),
                        row.dict["Name"], nullIfEmpty(row.dict["Location"]));
                }
                return(dict);
            }